how to implement test cases in a code?

I have completed my first code but i am unable to add testcases to it

Please read “How should I test my program” from FAQ.

We cannot help you with problem in live contest, but we can help you with some problem from practice section (for example this one - TEST Problem - CodeChef).