-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRupsa and Equilateral Triangle.cpp
More file actions
75 lines (57 loc) · 975 Bytes
/
Rupsa and Equilateral Triangle.cpp
File metadata and controls
75 lines (57 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* Ashutosh Verma - ashutoshvrm8@gmail.com
I don't know what to do :(
*/
#include<iostream>
#include<math.h>
#include<cstdio>
#define one 1;
#define four 4;
using namespace std;
void mad_man()
{
int p;
p=0;
}
int check(long long int number)
{
long long int sq,i=3,o;
o=number%2;
if(o==0)
{
while(number%2==0)
number=number/2;
}
sq=int((sqrt)(number));
while(i<sq+1)
{
if(number%i==0)
{
if(i%4==1)
return 1;
while(number%i==0)
number=number/i;
}
if(number==1)
break;
i=i+2;
}
if(number!=1)
if(number%4==1)
return one;
return 0;
}
int main()
{
long long int t,n,temp;
cin>>t;
while(t--)
{
cin>>n;
temp=check(n);
if(temp==1)
cout<<"YES\n";
else
cout<<"NO\n";
}
return 0;
}