-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNPL1701C.cpp
More file actions
41 lines (35 loc) · 699 Bytes
/
NPL1701C.cpp
File metadata and controls
41 lines (35 loc) · 699 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
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
long long int n,ans=0,p=1;
cin>>n;
for(long int i=0;i<n;i++)
{
long int a;
cin>>a;
p*=a;
}
//cout<<p<<endl;
long long int num=p;
for(long long int i=2;i*i<=num;i++)
{
while(p%i==0)
{
ans++;
p=p/i;
}
// cout<<ans<<endl;
}
// cout<<ans<<endl;
ans-=n;
if(ans%2==0)
cout<<"Friend"<<endl;
else
cout<<"Appu"<<endl;
}
}