Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(int argc, char** argv)
- {
- int count;
- scanf("%d", &count);
- for(int i = 0; i < count; i++) {
- int balls;
- scanf("%d", &balls);
- int size = 1;
- int steps = 0;
- while(balls >= size) {
- balls -= size;
- size += steps + 2;
- steps += 1;
- }
- printf("%i\n", steps);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement