fork(1) download
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int t,n;
  6. cin>>t;
  7. for(int e=0,a,b;e<t;e++)
  8. {
  9. cin>>n;
  10. for(int f=1;f<=n;f++)
  11. {
  12. a=f*(n-(2*(f-1)));
  13. b=(f+1)*(n-(2*f));
  14. if(a>b)
  15. {
  16. break;
  17.  
  18. }
  19. }
  20. cout<<a<<endl;
  21.  
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 3344KB
stdin
2
4
10
stdout
4
18