hiho week 292 register

Ended

Participants:43

Verdict:Accepted
Score:100 / 100
Submitted:2020-02-02 21:26:57

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<bits/stdc++.h>
using namespace std;
 
int n,t,m,a;
int main()
{
    cin>>t;
    while(t--){
        cin>>n;
        for(int m=floor(sqrt(2*n));m>=1;m--){
            int k=2*n;
            if(k%m==0){
                if((k/m-m+1)%2==0){
                    cout<<m<<endl;
                    break;
                }
            }
        }
    }
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX