Euclid proved extensions available, , if the integer solution
Portal: Infinite Fence
meaning of the questions: judge
R & lt between is less than a multiple of k
#include<bits/stdc++.h>
using namespace std;
int main(){
int T;
scanf("%d",&T);
while(T--){
int r,b,k;
scanf("%d%d%d",&r,&b,&k);
int t=__gcd(r,b);
if((max(r,b)-t-1)/min(r,b)+1<k) cout<<"OBEY"<<endl;
else cout<<"REBEL"<<endl;
}
return 0;
}
all common divisor of all factors a, b of.
The a, b factorising, g = gcd (a, b), the quality factor of the index
, So these factors make up the quality of public g, they all have these common divisor is composed of prime factors, so the direct request of the g factor.
Portal:about the number of
questions intended to: seek a, b of the total number of convention
#include<bits/stdc++.h>
using namespace std;
set<long long> st;
int main(){
long long a,b;
scanf("%lld%lld",&a,&b);
long long Gcd=__gcd(a,b);
long long t=sqrt(Gcd);
for(int i=1;i<=t;++i){
if(Gcd%i==0){
st.insert(i);
if(Gcd/i!=i) st.insert(Gcd/i);
}
}
set<long long > ::iterator it=st.begin();
for(;it!=st.end();++it){
cout<<*it<<" ";
}
return 0;
}
Portal: A. Good OL 'a Numbers Coloring
meaning of the questions: can
No sign painted white, the other black, assuming infinite 1- brands, brands whether black infinite
Solution:
if finite black sign, at a certain position after the start
Are white,
continuous need
to continuously
#include<bits/stdc++.h>
using namespace std;
set<int> s;
int main(){
int T;
scanf("%d",&T);
while(T--){
int a,b;
s.clear();
scanf("%d%d",&a,&b);
if(__gcd(a,b)==1){
cout<<"Finite"<<endl;
}
else cout<<"Infinite"<<endl;
}
return 0;
}