2023 rcpc
This commit is contained in:
38
2023/rcpc/d1/editorial/B. Coins.cpp
Normal file
38
2023/rcpc/d1/editorial/B. Coins.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
/// Gheorghies Alexandru
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
typedef long long ll;
|
||||
typedef pair<ll,ll> pll;
|
||||
|
||||
bool isPrime(ll num){
|
||||
if(num < 2)
|
||||
return false;
|
||||
|
||||
for(ll divisor = 2; divisor * divisor <= num; divisor++){
|
||||
if(num % divisor == 0)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
ios_base::sync_with_stdio(false); cin.tie(0);
|
||||
|
||||
ll k;
|
||||
cin>>k;
|
||||
for(ll i = 0; i < k; i++){
|
||||
ll n;
|
||||
cin>>n;
|
||||
if(n == 9)
|
||||
cout<<"Second\n";
|
||||
else if(n == 3)
|
||||
cout<<"First\n";
|
||||
else if(isPrime(n))
|
||||
cout<<"Second\n";
|
||||
else
|
||||
cout<<"First\n";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user