PHT - Pigeonhole Tower
Pigeon SSNA want to build a tower with some wood walls. Let's describe the tower they want to make:
- A Tower can consist of different number of level.
- If a tower contain L levels then 1st level must contain L holes, 2nd level L-1, 3rd level L-2 ….. L level contain 1 hole.
- Each room contain 3 wood walls.
See the picture below:
3 Level Tower | 4 Level tower |
Now pigeon SSNA has n wood walls. What is maximum number of level he can made.
Input
Input starts with an integer T (≤ 100000), denoting the number of test cases.
Each case starts with a line containing an integer n (1 ≤ n ≤ 1012)
Output
For each case of input you have to print the case number and expected answer.
Example
Input: 2 15 24 Output: Case 1: 3 Case 2: 4
hide comments
Lazar Jelic:
2014-12-01 00:26:45
Every time I submit my code it says "Runtime error (NZEC)" |
|
Shivam Mitra:
2014-10-23 23:28:01
got .6 points for this easy one :D |
|
tesla:
2014-10-20 22:38:12
Printing wrong case no. costed me 4 WA :( |
|
Malinga:
2014-10-19 09:25:00
space after :, got 2 WA for that.. |
|
numerix:
2014-10-18 20:54:54
@abhishek Yadav: If you need help, use the SPOJ forum. There you can post your code, explain the logic of your program etc. Last edit: 2014-10-18 20:55:07 |
|
Malinga:
2014-10-18 15:48:00
@numerix: can you help me please....it's a very simple problem and still m getting WA.. |
|
Malinga:
2014-10-18 15:46:56
it was not complete code just logic of the code...I am getting all answers correct using that logic but getting WA on submission so I wanted to know what's wrong there with the code.. |
|
numerix:
2014-10-18 15:40:24
@abhishek Yadav: Don't post any code here. Last edit: 2014-10-18 15:41:36 |
Added by: | Ajharul Islam Barid |
Date: | 2014-10-13 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU |
Resource: | Own Problem |