Hi Leppy,
I am using StringTokenizer to split the inputs by space and store in variables.
This program is taking 1s and is accepted in codechef.
Here the Time limit is 3s and still it is giving TLE.
multiple(100's+) System.out.println() will make the program slow, thats why StringBuilder to concat the result and giving output at one go.