int t,a; char c; intmain() { // ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); CI t; while (t--) { scanf("\n%c%d",&c,&a); F(i,1,8) if (i!=a) CO c<<i L; F(i,97,104) if (i!=c) CO (char)i<<a L; } return0; }
int t,n,a[26]; string s; intmain() { // ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); CI t; while (t--) { clear(a); CI n; CI s; F(i,0,n-1) a[s[i]-97]++; int m=0; F(i,0,25) m=max(m,a[i]); CO max(n%2,2*m-n) L; } return0; }
intmain() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); CI t; while (t--) { CI n; F(i,1,n) CI a[i]>>b[i]; LL l=0,r=1e9; while (l<=r) { LL mid=(l+r)/2; if (check(mid)) r=mid-1; else l=mid+1; } CO l L; } return0; }