Problem Description
"Pro-current range mirror tow soul fall red green skirt faintly to dream as true tears wet Trinidad Cloud"
In the MCA Mountain, in addition to live in many martial arts gallant, but also living a low-key outside man, his name by green dress, because often called "bamboo Dragonfly", eventually renamed to Green, perennial seclusion in the mountains, no longer see outsiders. According to the people around the mountain, there is a strange hobby, From the day he lived in, he began planting bamboo around his yard, planting 1 bamboos in the 1th month, 8 bamboos in the 2nd month, and 27 bamboos in the 3rd month ... The first N months of the species (n^3) roots of bamboo. He said that when he planted the first bamboo, he was back in the lake! Tell you the value of x, can you figure out the green comeback will be in the first few months?
Input
First enter a T, which indicates that there is a T-group of data, followed by a T-line. Each line is an integer x,x < 1000000000
Output
Outputs an integer n, indicating a comeback in the nth month
Sample Input
3
1
2
10
Sample Output
1
2
3
#include <iostream> int main (int argc, const char* argv[]) {int ncases = 0;
Std::cin >> ncases;
while (ncases--) {int n = 0;
Std::cin >> N;
int nSum = 0;
for (int i=1;; ++i) {nSum + = I*i*i;
if (nSum >= N) {std::cout << i << Std::endl;
Break
}}} return 0; }