Time Limit: 2 second(s) | Memory Limit: 32 MB |
Problem Description
You father give you n chocholates.you go to the school and you will now play with this chocolates...........
you decorate them in a good way like below
c
c c
c c c
c c c c
c c c c c
c c c c c c
now you have to calculate the number of lines l formed by your chocolates.if you cant complete a line then that line will be removed and eat the remaining chocolates.
the first line of input will be an integer T number of test case. next t lines contain an integer n the number of chocolates.
Print the number of lines l on the first line and then the number of chocolates you eat on the next line.
Input: 2 10 22 Output: 4 0 6 1
In case 1 with 10 chocolates 4 lines are formed and chocolate left 0. ...
Developed and Maintained by
JANE ALAM JAN |
Copyright © 2012
LightOJ, Jane Alam Jan |