A
int main() {
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif
int T;
cin>>T;
while(T--) {
int N,S,V;
cin>>N>>S>>V;
cout<<"01"[N<=S*V]<<al;
}
return 0;
}
B
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif
int k;
cin>>k;
vector<ll>a(k);
int i;
fz0k(i,k) {
cin>>a[i];
}
ll n,m,x;
cin>>n>>m>>x;
x%=m;
ll jyl=0;
fz0k(i,k) {
a[i]%=m;
jyl+=a[i];
}
//求b[n]/m
ll bn=x+jyl*(n/k);
fz0k(i,n%k) {
bn+=a[i];
}
cout<<n-bn/m<<al;
return 0;
}
C
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif
ll n,p;
cin>>n>>p;
vector<ll>a(n);
int i;
fz0k(i,n) {
cin>>a[i];
}
int wwx=0;
if(p&1) {
fz0k(i,n) {
wwx^=a[i]&1;
}
}
else {
fz0k(i,n) {
a[i]%=p+1;
if(a[i]==p) {
wwx^=2;
}
else {
wwx^=a[i]&1;
}
}
}
if(wwx==0) {
cout<<"BAD"<<al;
}
else {
cout<<"GOOD"<<al;
}
return 0;
}
I
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif
int i;
int n,q;
cin>>n>>q;
vector<int> a(n+1);
fz1(i,n-1) {
int x,y,w;
cin>>x>>y>>w;
a[x]^=w;
a[y]^=w;
}
while(q--) {
int opt,x,y,w;
cin>>opt;
if(opt==2) {
cin>>x;
cout<<a[x]<<al;
}
else {
cin>>x>>y>>w;
a[x]^=w;
a[y]^=w;
}
}
return 0;
}
J
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif
int i;
int n;
cin>>n;
vector<int>b(n+1);
fz1(i,n) {
cin>>b[i];
}
auto sqr=[](const int x) {
return x*x;
};
int m;
cin>>m;
while(m--) {
int opt,a,b1;
cin>>opt;
if(opt==1) {
cin>>a;
int oo=sqrt(b[a]);
int wwx=iinf;
fz(i,max(1,a-oo),min(n,a+oo)) {
wwx=min(wwx,sqr(a-i)+b[i]);
}
cout<<wwx<<al;
}
else {
cin>>a>>b1;
b[a]=min(b[a],b1);
}
}
return 0;
}
K
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif
int n,m;
cin>>n;
vector<int>a(n);
int i;
fz0k(i,n) {
cin>>a[i];
}
vector<int>b(n);
fz0k(i,n-1) {
b[i]=a[i]-a[i+1];
}
sort(b.begin(),b.end(),[](CI pp,CI qq) {
return pp>qq;
});
fz(i,1,(int)(b.size()-1)) {
b[i]+=b[i-1];
}
cin>>m;
while(m--) {
int opt,x;
cin>>opt>>x;
if(opt==1) {
if(x>1) {
cout<<a[0]-a[n-1]-b[x-2]<<al;
}
else {
cout<<a[0]-a[n-1]<<al;
}
}
}
return 0;
}
L
int main() {
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif
auto n=0;
cin>>n;
cout<<n-1<<endl;
return 0;
}