QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#174501 | #7179. Fischer's Chess Guessing Game | Crysfly | AC ✓ | 9ms | 16004kb | C++17 | 37.0kb | 2023-09-10 08:28:31 | 2023-09-10 08:28:31 |
Judging History
answer
// what is matter? never mind.
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2")
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
//#define int long long
#define ull unsigned long long
using namespace std;
inline int read()
{
char c=getchar();int x=0;bool f=0;
for(;!isdigit(c);c=getchar())f^=!(c^45);
for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
if(f)x=-x;return x;
}
int mod=1000000007;
struct modint{
int x;
modint(int o=0){x=o;}
modint &operator = (int o){return x=o,*this;}
modint &operator +=(modint o){return x=x+o.x>=mod?x+o.x-mod:x+o.x,*this;}
modint &operator -=(modint o){return x=x-o.x<0?x-o.x+mod:x-o.x,*this;}
modint &operator *=(modint o){return x=1ll*x*o.x%mod,*this;}
modint &operator ^=(int b){
modint a=*this,c=1;
for(;b;b>>=1,a*=a)if(b&1)c*=a;
return x=c.x,*this;
}
modint &operator /=(modint o){return *this *=o^=mod-2;}
friend modint operator +(modint a,modint b){return a+=b;}
friend modint operator -(modint a,modint b){return a-=b;}
friend modint operator *(modint a,modint b){return a*=b;}
friend modint operator /(modint a,modint b){return a/=b;}
friend modint operator ^(modint a,int b){return a^=b;}
friend bool operator ==(modint a,int b){return a.x==b;}
friend bool operator !=(modint a,int b){return a.x!=b;}
bool operator ! () {return !x;}
modint operator - () {return x?mod-x:0;}
bool operator <(const modint&b)const{return x<b.x;}
};
inline modint qpow(modint x,int y){return x^y;}
vector<modint> fac,ifac,iv;
inline void initC(int n)
{
if(iv.empty())fac=ifac=iv=vector<modint>(2,1);
int m=iv.size(); ++n;
if(m>=n)return;
iv.resize(n),fac.resize(n),ifac.resize(n);
For(i,m,n-1){
iv[i]=iv[mod%i]*(mod-mod/i);
fac[i]=fac[i-1]*i,ifac[i]=ifac[i-1]*iv[i];
}
}
inline modint C(int n,int m){
if(m<0||n<m)return 0;
return initC(n),fac[n]*ifac[m]*ifac[n-m];
}
inline modint sign(int n){return (n&1)?(mod-1):(1);}
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;
#define maxn 200005
#define inf 0x3f3f3f3f
int n;
string now;
string str[maxn];
int dis[1005][1005];
typedef bitset<968>bint;
mt19937_64 rnd(676);
int tot;
bint sta[maxn];
int qs[maxn],dep[maxn];
bint to[1005][9];
unordered_map<bint,int>mp,go,mpid;
map<string,int>smp;
bint tmp[9];
queue<bint>q;
int pw[20]={1,3,9,27,81,243,729,2187};
//bool dfs(bint s,int d)
//{
// int n=s.count();
// if(d>6)return 0;
// if(n<=1)return 1;
// if(d==6)return 0;
// if(mp.count(s))return mp[s];
//// if(d<=1)cout<<"dfs "<<n<<" "<<d<<"\n";
// bint t[9];
// for(int i=s._Find_first();i<n;i=s._Find_next(i)){
// bool ok=1;
// For(j,0,7){
// t[j]=(s&to[i][j]);
// if(t[j]==s){
// ok=0;
// break;
// }
// if(t[j].count()>pw[6-d]){
// ok=0;
// break;
// }
// }
// if(!ok)continue;
// For(j,0,7)if(!dfs(t[j],d+1)){ok=0;break;}
// if(ok)return go[s]=i,mp[s]=1;
// }
// For(i,0,n-1)if(!s[i]){
// bool ok=1;
// For(j,0,7){
// t[j]=(s&to[i][j]);
// if(t[j]==s){
// ok=0;
// break;
// }
// if(t[j].count()>pw[6-d]){
// ok=0;
// break;
// }
// }
// if(!ok)continue;
// For(j,0,7)if(!dfs(t[j],d+1)){ok=0;break;}
// if(ok)return go[s]=i,mp[s]=1;
// }
// return mp[s]=0;
//}
//
//void bfs(){
// tot=0;
// bint S; For(i,0,n-1)S.set(i); mpid[S]=++tot;
// queue< bint >q; q.push(S);
// cout<<"int ch[2333][9]={";
// while(q.size()){
// bint s=q.front();q.pop();
// int u=mpid[s];
// if(s.count()==1){
// qs[u]=s._Find_first();
// continue;
// }
// qs[u]=go[s];
// For(i,0,7){
// bint t=(s&to[qs[u]][i]);
// if(!t.count())continue;
// if(!mpid.count(t)){
// mpid[t]=++tot;
// q.push(t);
// }
// ch[u][i]=mpid[t];
// assert(ch[u][i]>0);
// }
// cout<<"{";
// For(i,0,7)cout<<ch[u][i]<<",";
// cout<<qs[u]<<"},";
// }
// cout<<"{0}};\n\n";
//}
int ch[2333][9]={{2,3,4,5,6,7,8,0,6},{9,10,11,12,13,14,15,0,0},{16,17,18,19,20,21,22,0,213},{23,24,25,26,27,28,29,0,218},{30,31,32,33,34,35,36,0,16},{37,38,39,40,41,42,0,0,7},{43,44,45,0,0,0,0,0,0},{46,47,48,49,50,0,0,0,3},{51,52,53,54,0,0,0,0,2},{55,56,57,58,0,0,0,0,2},{59,60,61,62,63,64,65,0,9},{0,66,67,68,69,70,0,0,3},{0,71,72,73,0,0,0,0,7},{74,75,76,0,0,0,0,0,5},{0,0,77,78,0,79,0,0,3},{0,80,81,82,83,84,0,0,23},{85,86,87,88,89,90,91,0,23},{92,93,94,95,96,97,98,0,39},{99,100,101,102,103,104,105,0,27},{106,107,108,109,110,0,0,0,5},{0,111,112,113,114,0,0,0,4},{0,115,116,117,118,0,0,0,4},{119,120,121,122,123,124,125,0,21},{126,127,128,129,130,131,132,0,33},{133,134,135,136,137,138,0,0,8},{139,140,141,142,143,144,0,0,51},{145,146,147,148,0,0,0,0,0},{0,149,150,0,0,0,0,0,0},{151,152,153,0,0,0,0,0,1},{0,154,155,156,157,0,0,0,15},{158,159,160,161,162,0,163,0,14},{164,165,166,167,168,169,170,0,27},{171,172,173,174,175,0,0,0,7},{176,177,178,179,180,181,0,0,2},{182,183,184,185,0,0,0,0,0},{0,0,0,0,0,0,0,0,748},{0,0,186,0,187,0,0,0,0},{0,188,189,190,191,0,0,0,8},{0,192,193,194,195,0,0,0,5},{196,197,198,0,199,0,0,0,9},{0,200,0,201,0,0,0,0,0},{0,0,0,0,0,0,0,0,648},{202,203,204,0,0,0,0,0,1},{0,205,206,207,208,209,0,0,8},{210,0,211,0,0,212,0,0,2},{0,0,0,0,0,0,0,0,134},{213,214,0,0,0,0,0,0,0},{0,0,215,216,217,0,0,0,2},{218,219,220,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,506},{0,221,222,223,224,225,0,0,5},{226,227,228,0,229,230,0,0,1},{0,231,232,233,234,0,0,0,1},{0,0,0,0,0,0,0,0,91},{0,235,236,237,238,239,0,0,4},{240,0,241,242,243,0,0,0,4},{244,245,246,247,248,0,0,0,5},{0,0,249,250,0,0,0,0,1},{251,252,253,254,0,0,0,0,2},{255,256,257,258,259,0,0,0,5},{260,261,262,263,0,0,0,0,2},{0,264,265,266,0,0,0,0,2},{0,267,0,268,0,0,0,0,2},{0,0,269,270,271,0,0,0,1},{0,0,0,0,0,0,0,0,702},{0,272,273,274,0,275,0,0,4},{276,277,0,278,0,0,0,0,2},{279,280,281,282,0,0,0,0,4},{0,0,0,0,0,0,0,0,150},{0,0,0,0,0,0,0,0,695},{0,0,0,0,0,0,0,0,603},{0,283,284,285,286,0,287,0,13},{288,289,290,291,0,0,0,0,2},{292,293,294,0,0,0,0,0,4},{0,0,0,0,0,0,0,0,661},{0,295,296,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,852},{297,298,299,300,0,0,0,0,4},{0,0,0,0,0,0,0,0,329},{0,0,301,0,302,0,0,0,0},{303,304,305,306,0,307,0,0,2},{308,309,0,310,311,0,0,0,0},{0,312,313,314,315,0,0,0,0},{0,0,0,0,0,0,0,0,851},{316,317,318,0,319,0,0,0,0},{320,321,322,323,324,0,0,0,3},{325,326,327,328,329,330,331,0,13},{332,333,334,335,336,337,0,0,7},{0,338,339,340,341,342,0,0,4},{0,0,0,343,344,345,0,0,0},{0,0,0,0,0,0,0,0,376},{346,347,348,349,0,0,0,0,5},{350,351,352,353,354,355,356,0,13},{357,358,359,360,361,362,363,0,4},{364,365,366,367,0,0,0,0,2},{368,369,370,371,372,373,0,0,4},{374,375,0,376,0,0,0,0,2},{0,0,0,0,0,0,0,0,862},{377,378,379,380,0,0,0,0,2},{381,382,383,384,0,385,0,0,9},{386,387,388,389,390,391,392,0,5},{393,394,395,396,397,0,0,0,2},{398,0,399,400,0,0,0,0,0},{0,401,402,0,0,0,0,0,0},{403,0,404,0,0,0,0,0,0},{0,405,406,0,0,407,0,0,0},{408,409,410,0,0,0,0,0,2},{411,412,413,414,415,0,0,0,3},{0,416,417,418,0,419,0,0,4},{420,421,0,0,0,0,0,0,0},{422,423,424,0,0,0,0,0,2},{0,425,426,0,427,0,0,0,0},{0,0,0,0,0,0,0,0,932},{0,0,0,0,0,0,0,0,211},{0,428,429,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,547},{0,0,0,0,0,0,0,0,818},{0,0,0,0,0,0,0,0,541},{0,430,431,432,0,433,0,0,0},{0,434,435,436,0,0,0,0,3},{437,438,439,440,441,442,0,0,0},{443,444,445,446,447,0,0,0,2},{448,449,450,451,0,0,0,0,0},{452,453,454,0,0,0,0,0,0},{455,456,457,0,0,0,0,0,0},{0,458,459,460,461,462,0,0,2},{463,464,465,466,467,468,0,0,11},{469,470,471,472,473,474,0,0,4},{475,476,477,478,479,0,0,0,4},{480,481,482,483,0,0,0,0,0},{0,484,485,0,0,0,0,0,0},{0,0,486,487,0,0,0,0,0},{488,489,490,491,0,0,0,0,2},{492,493,494,495,0,0,496,0,4},{497,498,499,500,501,502,503,0,10},{504,505,506,507,0,508,0,0,0},{0,509,510,511,512,513,0,0,3},{0,514,0,515,0,0,0,0,1},{0,516,517,0,0,0,0,0,0},{518,519,520,521,522,523,0,0,8},{524,525,526,527,528,529,530,0,10},{531,532,533,534,535,0,0,0,2},{536,537,538,539,540,0,541,0,5},{0,0,0,0,0,0,0,0,741},{0,542,0,543,0,0,0,0,2},{544,545,546,0,0,0,0,0,7},{547,0,0,548,0,0,0,0,1},{549,550,551,552,0,0,0,0,5},{553,0,0,554,0,0,0,0,1},{555,0,556,0,0,0,0,0,1},{0,0,557,558,0,0,0,0,0},{0,559,560,561,0,0,0,0,2},{0,0,0,0,0,0,0,0,756},{0,562,563,0,564,0,565,0,7},{566,567,0,0,568,0,0,0,4},{569,0,570,571,0,0,0,0,0},{0,0,0,0,0,0,0,0,911},{0,572,573,574,575,576,577,0,10},{0,578,579,580,581,0,0,0,3},{582,583,584,585,0,0,0,0,5},{0,586,587,0,0,0,0,0,1},{0,0,588,0,589,0,0,0,0},{0,0,0,0,0,0,0,0,398},{590,591,592,593,594,595,0,0,4},{596,597,598,599,600,601,602,0,5},{0,603,604,605,606,0,0,0,2},{607,608,609,0,0,0,0,0,1},{0,610,611,0,0,0,0,0,2},{612,613,0,0,0,0,0,0,0},{614,615,0,0,0,0,0,0,1},{0,0,616,0,617,618,619,0,2},{620,621,622,623,0,0,0,0,4},{0,624,625,626,0,627,628,0,5},{629,630,631,632,633,0,0,0,5},{0,0,634,0,635,0,0,0,0},{636,637,0,0,0,0,0,0,0},{638,639,0,640,641,0,0,0,4},{0,0,0,0,0,0,0,0,739},{0,642,643,644,0,0,0,0,0},{0,0,0,0,0,0,0,0,713},{0,0,0,0,0,0,0,0,199},{0,0,0,0,0,0,0,0,846},{0,645,0,646,0,647,0,0,2},{0,0,0,0,0,0,0,0,196},{0,0,0,0,0,0,0,0,552},{648,649,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,102},{650,651,0,0,0,0,0,0,0},{652,653,654,0,0,0,0,0,0},{0,655,656,657,0,0,0,0,3},{658,659,0,660,0,0,0,0,1},{661,0,662,0,0,0,0,0,3},{663,664,0,665,666,0,0,0,8},{0,667,668,669,0,0,0,0,4},{0,0,0,0,0,0,0,0,602},{670,671,672,673,674,0,0,0,3},{675,676,677,0,0,0,0,0,0},{0,678,679,680,0,681,0,0,3},{0,682,683,684,0,0,0,0,0},{685,686,687,688,0,0,0,0,4},{0,0,0,0,0,0,0,0,38},{0,0,0,0,0,0,0,0,599},{689,690,691,0,0,0,0,0,4},{0,0,0,0,0,0,0,0,582},{692,693,0,0,0,0,0,0,1},{0,0,694,695,696,0,0,0,2},{697,698,699,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,316},{0,700,701,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,82},{0,0,0,0,0,0,0,0,93},{0,0,0,0,0,0,0,0,642},{0,0,0,0,0,0,0,0,719},{0,0,0,0,0,0,0,0,757},{0,0,0,0,0,0,0,0,522},{0,0,0,0,0,0,0,0,763},{0,0,0,0,0,0,0,0,908},{0,0,0,0,0,0,0,0,671},{0,0,0,0,0,0,0,0,328},{0,0,0,0,0,0,0,0,843},{0,0,0,0,0,0,0,0,924},{0,0,0,0,0,0,0,0,947},{0,0,0,0,0,0,0,0,883},{0,702,0,703,0,0,0,0,1},{0,0,0,0,0,0,0,0,454},{0,0,0,0,0,0,0,0,81},{0,0,0,0,0,0,0,0,594},{0,0,0,0,0,0,0,0,827},{0,0,0,0,0,0,0,0,232},{0,0,0,0,0,0,0,0,657},{0,0,0,0,0,0,0,0,608},{0,0,0,0,0,0,0,0,305},{0,0,0,0,0,0,0,0,32},{0,0,0,0,0,0,0,0,837},{0,704,705,0,0,0,0,0,1},{0,706,707,708,709,0,0,0,1},{0,0,0,0,0,0,0,0,785},{0,0,0,0,0,0,0,0,490},{0,0,0,0,0,0,0,0,397},{0,0,0,0,0,0,0,0,743},{0,0,710,0,711,0,0,0,1},{712,713,0,714,0,715,0,0,1},{0,0,716,717,0,0,0,0,1},{0,718,719,0,0,0,0,0,1},{0,720,0,0,721,0,722,0,1},{0,0,0,0,0,0,0,0,181},{0,0,0,0,0,0,0,0,251},{0,0,0,0,0,0,0,0,952},{0,0,0,0,0,0,0,0,295},{0,0,0,0,0,0,0,0,447},{0,0,0,0,0,0,0,0,521},{0,0,0,0,0,0,0,0,244},{0,0,0,723,0,724,0,0,1},{0,0,725,726,0,0,0,0,1},{0,0,0,0,0,0,0,0,938},{0,727,0,0,0,728,0,0,1},{729,0,0,0,0,730,0,0,1},{0,731,0,732,0,0,0,0,1},{0,0,0,0,0,0,0,0,788},{733,0,734,0,0,0,0,0,1},{0,735,0,736,0,0,0,0,1},{0,737,738,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,806},{0,0,739,740,0,0,0,0,1},{0,0,0,0,0,0,0,0,511},{0,0,741,0,0,0,742,0,1},{0,743,744,745,0,0,0,0,1},{0,0,0,0,0,0,0,0,858},{0,0,0,0,0,0,0,0,118},{0,0,0,0,0,0,0,0,39},{0,0,0,0,0,0,0,0,234},{746,0,747,0,748,0,0,0,2},{0,749,0,0,750,0,0,0,1},{751,752,0,753,0,0,0,0,1},{0,0,0,0,0,0,0,0,791},{0,0,0,0,0,0,0,0,755},{754,755,756,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,149},{0,0,0,0,0,0,0,0,343},{0,0,0,0,0,0,0,0,803},{0,0,757,0,758,0,0,0,1},{0,0,759,0,760,0,0,0,1},{0,761,762,0,0,0,0,0,1},{763,0,764,0,765,0,0,0,2},{766,0,767,768,769,770,0,0,2},{0,771,0,772,0,0,0,0,1},{0,0,0,0,0,0,0,0,796},{0,773,774,0,0,0,0,0,1},{775,776,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,654},{0,0,0,0,0,0,0,0,75},{777,778,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,381},{0,0,779,0,780,0,0,0,1},{0,0,0,0,0,0,0,0,26},{0,0,0,0,0,0,0,0,810},{0,0,0,0,0,0,0,0,539},{781,782,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,79},{0,0,0,0,0,0,0,0,365},{0,783,784,785,0,0,0,0,1},{0,786,0,787,0,0,0,0,1},{0,0,788,789,0,0,0,0,0},{790,791,792,793,0,0,0,0,1},{0,0,0,0,0,0,0,0,467},{0,794,795,796,0,0,0,0,1},{0,0,0,0,0,0,0,0,119},{0,0,0,0,0,0,0,0,220},{0,0,0,0,0,0,0,0,404},{0,0,797,798,0,0,799,0,2},{0,0,0,0,0,0,0,0,718},{0,0,0,0,0,0,0,0,679},{0,0,800,801,0,802,0,0,1},{0,0,803,0,804,0,0,0,1},{0,0,0,0,0,0,0,0,514},{0,0,0,0,0,0,0,0,681},{0,0,0,0,0,0,0,0,339},{0,0,0,0,0,0,0,0,897},{0,0,0,0,0,0,0,0,460},{805,806,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,25},{0,807,808,0,0,0,0,0,0},{0,809,810,0,0,811,0,0,1},{0,0,0,812,0,813,0,0,0},{814,815,0,0,0,0,0,0,0},{0,816,817,818,0,0,0,0,1},{819,820,821,822,0,0,0,0,0},{0,0,0,823,824,0,0,0,0},{0,825,0,0,826,0,827,0,0},{0,0,0,0,0,0,0,0,278},{0,0,0,0,0,0,0,0,125},{0,0,0,0,0,0,0,0,333},{0,0,828,829,830,831,0,0,1},{0,832,0,0,833,834,0,0,0},{835,836,837,838,0,0,0,0,2},{0,0,0,0,839,840,841,0,0},{0,0,0,0,0,0,0,0,274},{0,842,843,844,0,845,0,0,0},{0,0,846,847,0,848,0,0,1},{849,850,0,0,0,0,0,0,0},{0,851,852,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,368},{0,853,0,854,0,0,0,0,1},{0,0,0,0,0,0,0,0,137},{0,0,0,0,0,0,0,0,538},{0,855,856,857,0,0,0,0,2},{0,858,859,860,0,861,0,0,0},{0,0,862,0,863,0,0,0,0},{0,0,0,0,0,0,0,0,957},{0,0,0,0,0,0,0,0,787},{864,865,866,867,0,0,0,0,2},{868,0,869,0,870,0,0,0,0},{0,871,872,873,874,0,0,0,3},{0,0,0,0,0,0,0,0,253},{875,876,877,878,0,0,0,0,2},{0,0,879,880,0,0,0,0,0},{881,882,883,884,0,0,0,0,0},{0,885,0,886,0,0,0,0,0},{887,888,889,890,0,0,0,0,0},{0,891,892,0,0,0,0,0,0},{893,894,895,896,0,0,0,0,1},{0,897,898,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,307},{899,0,900,0,0,0,0,0,1},{901,902,903,904,0,0,0,0,3},{905,906,0,0,907,908,909,0,3},{910,911,912,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,513},{0,913,914,0,0,0,0,0,1},{0,0,915,0,916,0,0,0,0},{0,917,0,0,0,918,0,0,0},{0,0,0,0,0,0,0,0,921},{0,0,0,0,0,0,0,0,409},{0,0,0,0,0,0,0,0,410},{0,0,0,0,0,0,0,0,9},{0,0,0,0,0,0,0,0,922},{0,919,0,0,920,921,0,0,0},{922,0,0,923,0,0,0,0,0},{924,925,926,927,928,0,0,0,3},{0,0,0,0,0,0,0,0,744},{0,929,930,0,931,0,0,0,0},{932,933,934,935,0,0,0,0,0},{0,936,937,0,0,0,0,0,0},{0,938,939,940,941,0,0,0,0},{0,0,0,0,0,0,0,0,252},{0,942,943,0,0,0,0,0,1},{0,944,0,945,0,0,0,0,1},{946,947,948,949,0,0,0,0,0},{0,0,0,0,0,0,0,0,457},{0,950,951,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,943},{0,0,0,0,0,0,0,0,206},{0,952,953,0,0,0,0,0,0},{0,954,955,956,957,0,0,0,0},{0,958,959,0,0,0,0,0,0},{0,960,0,961,962,0,0,0,1},{963,0,964,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,354},{0,0,0,0,0,0,0,0,422},{965,966,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,571},{0,0,0,0,0,0,0,0,473},{0,0,0,0,0,0,0,0,175},{0,0,0,0,0,0,0,0,269},{0,0,0,0,0,0,0,0,350},{0,0,0,0,0,0,0,0,174},{0,0,0,0,0,0,0,0,225},{967,0,968,0,0,0,0,0,0},{969,0,970,971,0,972,0,0,1},{0,0,973,974,975,0,0,0,0},{0,0,0,0,0,0,0,0,462},{0,976,977,0,978,0,0,0,1},{979,980,0,0,0,0,0,0,1},{0,0,981,982,0,0,0,0,0},{0,0,0,0,0,0,0,0,500},{0,0,0,0,0,0,0,0,694},{0,983,984,0,0,0,0,0,0},{0,985,986,0,0,0,0,0,0},{987,0,988,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,831},{0,0,0,0,0,0,0,0,612},{0,989,0,0,990,0,0,0,0},{0,991,992,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,250},{0,0,0,0,0,0,0,0,812},{993,0,994,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,958},{0,0,0,0,0,0,0,0,527},{0,0,0,0,0,0,0,0,222},{0,0,995,0,996,0,0,0,1},{0,997,998,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,865},{0,0,0,0,0,0,0,0,628},{0,999,1000,1001,1002,0,0,0,1},{0,1003,1004,1005,1006,0,0,0,0},{0,1007,1008,1009,0,0,0,0,0},{0,0,0,0,0,0,0,0,84},{0,1010,0,1011,1012,0,0,0,1},{0,1013,0,1014,0,0,0,0,1},{0,1015,1016,1017,0,1018,0,0,2},{0,0,0,0,0,0,0,0,856},{0,0,0,0,0,0,0,0,464},{0,1019,0,1020,0,0,0,0,0},{0,0,0,0,0,0,0,0,715},{0,0,0,0,0,0,0,0,446},{0,1021,1022,0,0,0,0,0,0},{0,0,1023,1024,0,0,0,0,1},{0,0,1025,1026,0,0,0,0,1},{0,0,1027,1028,0,0,0,0,1},{1029,0,1030,0,0,0,0,0,1},{1031,0,1032,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,778},{0,0,0,0,0,0,0,0,528},{0,0,0,0,0,0,0,0,662},{0,0,0,0,0,0,0,0,357},{0,0,0,0,0,0,0,0,268},{0,0,0,0,0,0,0,0,459},{1033,1034,1035,0,0,0,0,0,0},{0,1036,1037,1038,0,0,0,0,1},{1039,0,1040,1041,0,0,0,0,0},{0,1042,1043,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,298},{0,0,0,0,0,0,0,0,917},{1044,1045,1046,1047,0,0,0,0,3},{1048,1049,0,1050,1051,0,1052,0,3},{1053,1054,0,1055,0,0,0,0,0},{0,0,1056,1057,0,0,1058,0,1},{0,0,0,0,0,0,0,0,184},{0,0,0,0,0,0,0,0,895},{0,1059,1060,0,1061,0,0,0,2},{1062,1063,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,123},{0,0,0,0,0,0,0,0,579},{0,0,0,0,0,0,0,0,386},{0,0,0,0,0,0,0,0,849},{0,1064,1065,1066,0,0,0,0,0},{1067,1068,0,1069,1070,0,0,0,0},{1071,1072,1073,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,54},{0,0,0,0,0,0,0,0,489},{0,0,0,0,0,0,0,0,727},{0,1074,1075,0,0,0,0,0,1},{0,1076,1077,0,1078,0,0,0,2},{0,0,0,0,0,0,0,0,690},{0,0,0,0,0,0,0,0,158},{0,0,0,0,0,0,0,0,857},{0,0,0,0,0,0,0,0,564},{0,0,0,0,0,0,0,0,320},{0,0,0,0,0,0,0,0,874},{1079,1080,0,0,0,0,0,0,0},{1081,0,0,0,1082,0,0,0,0},{0,1083,0,1084,1085,0,0,0,1},{1086,1087,1088,1089,0,0,0,0,1},{1090,1091,1092,0,0,0,0,0,1},{1093,1094,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,930},{0,0,0,0,0,0,0,0,322},{0,1095,1096,0,1097,1098,0,0,3},{1099,1100,1101,0,1102,0,0,0,2},{1103,1104,1105,0,0,0,0,0,0},{1106,1107,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,334},{0,0,0,0,0,0,0,0,53},{1108,1109,1110,1111,0,0,0,0,2},{1112,1113,1114,1115,1116,0,0,0,1},{1117,1118,0,1119,0,0,0,0,1},{0,1120,1121,1122,0,0,1123,0,3},{0,0,0,0,0,0,0,0,362},{1124,0,0,1125,0,0,0,0,0},{0,1126,1127,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,951},{0,0,0,0,0,0,0,0,955},{0,1128,0,1129,0,0,0,0,1},{0,0,0,0,0,0,0,0,779},{0,0,0,0,0,0,0,0,311},{0,0,0,0,0,0,0,0,249},{0,0,0,0,0,0,0,0,537},{0,1130,1131,0,0,0,0,0,0},{0,1132,1133,1134,1135,1136,0,0,3},{1137,1138,1139,0,0,0,0,0,2},{0,0,0,0,0,0,0,0,170},{0,1140,1141,1142,1143,0,0,0,1},{0,1144,1145,1146,0,0,0,0,0},{0,1147,1148,0,0,0,0,0,0},{0,1149,1150,0,1151,1152,0,0,3},{0,0,1153,0,1154,1155,0,0,2},{0,1156,1157,1158,0,0,0,0,2},{0,0,0,0,0,0,0,0,63},{0,1159,1160,1161,0,0,0,0,2},{0,0,0,0,0,0,0,0,586},{0,1162,1163,0,0,0,0,0,0},{1164,1165,1166,0,0,0,0,0,1},{0,1167,1168,1169,0,0,0,0,0},{0,0,0,1170,1171,0,0,0,0},{0,0,0,0,0,0,0,0,914},{0,1172,1173,0,0,0,0,0,0},{1174,1175,1176,0,0,0,0,0,0},{0,1177,1178,0,0,0,0,0,0},{0,1179,0,1180,1181,0,0,0,2},{0,0,0,0,0,0,0,0,821},{0,0,0,0,0,0,0,0,453},{1182,0,1183,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,674},{0,0,0,0,0,0,0,0,458},{0,1184,1185,1186,1187,1188,0,0,4},{1189,1190,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,364},{0,0,0,0,0,0,0,0,140},{0,1191,1192,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,668},{1193,1194,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,559},{0,0,0,0,0,0,0,0,321},{0,0,0,0,0,0,0,0,814},{0,0,0,0,0,0,0,0,866},{0,0,0,0,0,0,0,0,501},{0,0,0,0,0,0,0,0,135},{0,0,0,0,0,0,0,0,147},{0,0,0,0,0,0,0,0,201},{0,0,0,0,0,0,0,0,905},{0,0,0,0,0,0,0,0,672},{0,0,1195,1196,1197,0,0,0,2},{0,1198,1199,1200,1201,0,0,0,3},{0,0,0,0,0,0,0,0,218},{0,0,0,0,0,0,0,0,703},{0,0,0,0,0,0,0,0,374},{0,0,1202,1203,1204,0,0,0,2},{0,0,0,0,0,0,0,0,797},{1205,1206,1207,0,0,0,0,0,1},{1208,1209,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,418},{0,0,0,0,0,0,0,0,443},{0,1210,1211,1212,0,0,0,0,1},{0,0,0,0,0,0,0,0,176},{1213,1214,1215,0,0,0,0,0,0},{1216,1217,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,838},{1218,1219,0,1220,1221,0,0,0,0},{1222,1223,1224,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,920},{0,0,0,0,0,0,0,0,162},{0,0,0,0,0,0,0,0,948},{1225,1226,1227,0,0,0,0,0,0},{0,0,1228,0,1229,0,0,0,0},{0,1230,1231,0,1232,1233,0,0,3},{0,1234,1235,0,1236,0,0,0,2},{0,1237,0,1238,0,0,0,0,0},{0,1239,0,1240,0,0,0,0,1},{0,0,0,0,0,0,0,0,271},{0,0,1241,1242,0,0,0,0,0},{1243,0,0,1244,0,0,0,0,1},{0,0,0,0,0,0,0,0,261},{0,0,0,0,0,0,0,0,877},{0,0,0,0,0,0,0,0,165},{0,0,0,0,0,0,0,0,686},{0,0,0,0,0,0,0,0,204},{1245,1246,1247,0,0,0,0,0,1},{1248,1249,1250,0,0,1251,1252,0,3},{1253,1254,1255,1256,1257,0,0,0,3},{1258,1259,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,746},{0,0,0,0,0,0,0,0,205},{1260,0,1261,1262,0,0,0,0,0},{1263,1264,0,0,0,0,0,0,1},{1265,1266,1267,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,50},{1268,0,1269,1270,0,0,0,0,2},{1271,1272,1273,0,0,0,0,0,0},{1274,0,1275,0,0,1276,1277,0,2},{0,1278,1279,0,0,0,0,0,1},{1280,1281,1282,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,161},{0,0,0,0,0,0,0,0,479},{0,0,0,0,0,0,0,0,844},{0,0,0,0,0,0,0,0,66},{0,0,0,0,0,0,0,0,49},{0,0,0,0,0,0,0,0,637},{0,0,0,0,0,0,0,0,178},{0,0,0,0,0,0,0,0,524},{1283,0,1284,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,101},{0,1285,1286,0,0,0,0,0,0},{1287,1288,0,0,0,0,0,0,0},{1289,1290,0,1291,1292,1293,0,0,2},{0,1294,1295,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,284},{0,0,0,0,0,0,0,0,808},{0,0,0,0,0,0,0,0,926},{0,0,0,0,0,0,0,0,34},{1296,1297,0,1298,0,0,0,0,2},{0,1299,1300,1301,0,0,0,0,1},{0,0,0,0,0,0,0,0,424},{0,0,0,0,0,0,0,0,845},{0,0,0,0,0,0,0,0,191},{0,0,0,0,0,0,0,0,566},{0,0,0,0,0,0,0,0,193},{0,0,0,0,0,0,0,0,502},{0,1302,1303,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,380},{0,0,0,0,0,0,0,0,442},{1304,0,1305,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,508},{0,0,1306,1307,0,0,0,0,1},{0,0,0,0,0,0,0,0,790},{0,1308,1309,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,142},{0,0,0,0,0,0,0,0,959},{0,0,0,0,0,0,0,0,824},{0,0,0,0,0,0,0,0,262},{0,0,0,0,0,0,0,0,148},{1310,1311,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,676},{0,0,1312,0,1313,0,1314,0,2},{1315,0,0,1316,0,0,0,0,1},{0,0,0,0,0,0,0,0,896},{1317,1318,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,577},{0,1319,1320,0,0,0,0,0,0},{0,1321,1322,0,1323,1324,0,0,3},{0,1325,1326,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,789},{0,0,1327,1328,1329,0,0,0,2},{0,0,0,0,0,0,0,0,136},{1330,1331,1332,0,1333,0,0,0,1},{1334,0,0,0,1335,0,0,0,1},{1336,1337,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,488},{0,0,0,0,0,0,0,0,711},{0,1338,1339,1340,0,0,0,0,2},{0,1341,1342,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,280},{0,0,0,0,0,0,0,0,560},{1343,1344,0,0,0,0,0,0,1},{0,1345,0,1346,0,0,0,0,0},{0,0,0,0,0,0,0,0,428},{0,0,0,0,0,0,0,0,356},{0,0,0,0,0,0,0,0,753},{0,1347,1348,1349,0,0,0,0,2},{1350,1351,1352,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,892},{0,0,0,0,0,0,0,0,89},{0,1353,1354,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,898},{0,0,0,0,0,0,0,0,282},{1355,1356,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,485},{0,0,0,0,0,0,0,0,163},{0,0,0,0,0,0,0,0,286},{0,0,0,0,0,0,0,0,850},{0,0,0,0,0,0,0,0,51},{0,0,1357,1358,0,1359,0,0,2},{0,0,0,0,0,0,0,0,707},{0,0,0,0,0,0,0,0,421},{1360,1361,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,41},{0,0,0,0,0,0,0,0,704},{0,0,0,0,0,0,0,0,644},{0,0,0,0,0,0,0,0,913},{0,0,0,0,0,0,0,0,167},{0,0,0,0,0,0,0,0,216},{0,0,0,0,0,0,0,0,11},{0,0,0,0,0,0,0,0,429},{0,0,0,0,0,0,0,0,512},{0,0,0,0,0,0,0,0,304},{0,0,0,0,0,0,0,0,710},{0,0,0,0,0,0,0,0,190},{0,0,0,0,0,0,0,0,452},{0,0,0,0,0,0,0,0,647},{0,0,0,0,0,0,0,0,138},{0,0,0,0,0,0,0,0,412},{0,0,0,0,0,0,0,0,195},{0,0,0,0,0,0,0,0,783},{0,0,0,0,0,0,0,0,781},{0,0,0,0,0,0,0,0,773},{0,0,0,0,0,0,0,0,728},{0,0,0,0,0,0,0,0,312},{0,0,0,0,0,0,0,0,126},{0,0,0,0,0,0,0,0,606},{0,0,0,0,0,0,0,0,873},{0,0,0,0,0,0,0,0,542},{0,0,0,0,0,0,0,0,667},{0,0,0,0,0,0,0,0,587},{0,0,0,0,0,0,0,0,535},{0,0,0,0,0,0,0,0,129},{0,0,0,0,0,0,0,0,407},{0,0,0,0,0,0,0,0,890},{0,0,0,0,0,0,0,0,256},{0,0,0,0,0,0,0,0,546},{0,0,0,0,0,0,0,0,591},{0,0,0,0,0,0,0,0,817},{0,0,0,0,0,0,0,0,272},{0,0,0,0,0,0,0,0,640},{0,0,0,0,0,0,0,0,894},{0,0,0,0,0,0,0,0,213},{0,0,0,0,0,0,0,0,946},{0,0,0,0,0,0,0,0,569},{0,0,0,0,0,0,0,0,37},{0,0,0,0,0,0,0,0,186},{0,0,0,0,0,0,0,0,240},{0,0,0,0,0,0,0,0,375},{0,0,0,0,0,0,0,0,353},{0,0,0,0,0,0,0,0,120},{0,0,0,0,0,0,0,0,784},{0,0,0,0,0,0,0,0,384},{0,0,0,0,0,0,0,0,303},{0,0,0,0,0,0,0,0,80},{0,0,0,0,0,0,0,0,203},{0,0,0,0,0,0,0,0,688},{0,0,0,0,0,0,0,0,197},{0,0,0,0,0,0,0,0,592},{0,0,0,0,0,0,0,0,768},{0,0,0,0,0,0,0,0,399},{0,0,0,0,0,0,0,0,554},{0,0,0,0,0,0,0,0,77},{0,0,0,0,0,0,0,0,44},{0,0,0,0,0,0,0,0,737},{0,0,0,0,0,0,0,0,631},{0,0,0,0,0,0,0,0,423},{0,0,0,0,0,0,0,0,610},{0,0,0,0,0,0,0,0,919},{0,0,0,0,0,0,0,0,553},{0,0,0,0,0,0,0,0,549},{0,0,0,0,0,0,0,0,870},{0,0,0,0,0,0,0,0,794},{0,0,0,0,0,0,0,0,164},{0,0,0,0,0,0,0,0,434},{0,0,0,0,0,0,0,0,557},{0,0,0,0,0,0,0,0,766},{0,0,0,0,0,0,0,0,520},{0,0,0,0,0,0,0,0,391},{0,0,0,0,0,0,0,0,417},{0,0,0,0,0,0,0,0,598},{0,0,0,0,0,0,0,0,69},{0,0,0,0,0,0,0,0,772},{0,0,0,0,0,0,0,0,198},{0,0,0,0,0,0,0,0,300},{0,0,0,0,0,0,0,0,941},{0,0,0,0,0,0,0,0,200},{0,0,0,0,0,0,0,0,835},{0,0,0,0,0,0,0,0,12},{0,0,0,0,0,0,0,0,498},{0,0,0,0,0,0,0,0,379},{0,0,0,0,0,0,0,0,342},{0,0,0,0,0,0,0,0,229},{0,0,0,0,0,0,0,0,879},{0,0,0,0,0,0,0,0,531},{0,0,0,0,0,0,0,0,573},{0,0,0,0,0,0,0,0,98},{0,0,0,0,0,0,0,0,377},{0,0,0,0,0,0,0,0,296},{0,0,0,0,0,0,0,0,673},{0,0,0,0,0,0,0,0,798},{0,0,0,0,0,0,0,0,550},{0,0,0,0,0,0,0,0,264},{0,0,0,0,0,0,0,0,721},{0,0,0,0,0,0,0,0,117},{0,0,0,0,0,0,0,0,907},{0,0,0,0,0,0,0,0,236},{0,0,0,0,0,0,0,0,241},{0,0,0,0,0,0,0,0,687},{0,0,0,0,0,0,0,0,432},{0,0,0,0,0,0,0,0,152},{0,0,0,0,0,0,0,0,65},{0,0,0,0,0,0,0,0,633},{0,0,0,0,0,0,0,0,194},{0,0,0,0,0,0,0,0,419},{0,0,0,0,0,0,0,0,859},{0,0,0,0,0,0,0,0,716},{0,0,0,0,0,0,0,0,749},{0,0,0,0,0,0,0,0,762},{0,0,0,0,0,0,0,0,634},{0,0,0,0,0,0,0,0,548},{0,0,0,0,0,0,0,0,115},{0,0,0,0,0,0,0,0,653},{0,0,0,0,0,0,0,0,103},{0,0,0,0,0,0,0,0,315},{0,0,0,0,0,0,0,0,55},{0,0,0,0,0,0,0,0,665},{0,0,0,0,0,0,0,0,310},{0,0,0,0,0,0,0,0,396},{0,0,0,0,0,0,0,0,714},{0,0,0,0,0,0,0,0,869},{0,0,0,0,0,0,0,0,735},{0,0,0,0,0,0,0,0,383},{0,0,0,0,0,0,0,0,641},{0,0,0,0,0,0,0,0,188},{0,0,0,0,0,0,0,0,761},{0,0,0,0,0,0,0,0,40},{0,0,0,0,0,0,0,0,180},{0,0,0,0,0,0,0,0,747},{0,0,0,0,0,0,0,0,931},{0,0,0,0,0,0,0,0,656},{0,0,0,0,0,0,0,0,248},{0,0,0,0,0,0,0,0,923},{0,0,0,0,0,0,0,0,445},{0,0,0,0,0,0,0,0,169},{0,0,0,0,0,0,0,0,31},{0,0,0,0,0,0,0,0,659},{0,0,0,0,0,0,0,0,239},{0,0,0,0,0,0,0,0,426},{0,0,0,0,0,0,0,0,166},{0,0,0,0,0,0,0,0,544},{0,0,0,0,0,0,0,0,601},{0,0,0,0,0,0,0,0,472},{0,0,0,0,0,0,0,0,751},{0,0,0,0,0,0,0,0,336},{0,0,0,0,0,0,0,0,936},{0,0,0,0,0,0,0,0,361},{0,0,0,0,0,0,0,0,724},{0,0,0,0,0,0,0,0,565},{0,0,0,0,0,0,0,0,670},{0,0,0,0,0,0,0,0,294},{0,0,0,0,0,0,0,0,942},{0,0,0,0,0,0,0,0,61},{0,0,0,0,0,0,0,0,916},{0,0,0,0,0,0,0,0,617},{0,0,0,0,0,0,0,0,622},{0,0,0,0,0,0,0,0,709},{0,0,0,0,0,0,0,0,767},{0,0,0,0,0,0,0,0,903},{0,0,0,0,0,0,0,0,287},{0,0,0,0,0,0,0,0,230},{0,0,0,0,0,0,0,0,518},{0,0,0,0,0,0,0,0,650},{0,0,0,0,0,0,0,0,231},{0,0,0,0,0,0,0,0,853},{0,0,0,0,0,0,0,0,313},{0,0,0,0,0,0,0,0,530},{0,0,0,0,0,0,0,0,621},{0,0,0,0,0,0,0,0,875},{0,0,0,0,0,0,0,0,90},{0,0,0,0,0,0,0,0,48},{0,0,0,0,0,0,0,0,71},{0,0,0,0,0,0,0,0,543},{0,0,0,0,0,0,0,0,918},{0,0,0,0,0,0,0,0,534},{0,0,0,0,0,0,0,0,529},{0,0,0,0,0,0,0,0,157},{0,0,0,0,0,0,0,0,207},{0,0,0,0,0,0,0,0,401},{0,0,0,0,0,0,0,0,499},{0,0,0,0,0,0,0,0,413},{0,0,0,0,0,0,0,0,588},{0,0,0,0,0,0,0,0,823},{0,0,0,0,0,0,0,0,563},{0,0,0,0,0,0,0,0,127},{0,0,0,0,0,0,0,0,441},{0,0,0,0,0,0,0,0,465},{0,0,0,0,0,0,0,0,635},{0,0,0,0,0,0,0,0,944},{0,0,0,0,0,0,0,0,20},{0,0,0,0,0,0,0,0,697},{0,0,0,0,0,0,0,0,720},{0,0,0,0,0,0,0,0,770},{0,0,0,0,0,0,0,0,326},{0,0,0,0,0,0,0,0,319},{0,0,0,0,0,0,0,0,731},{0,0,0,0,0,0,0,0,259},{0,0,0,0,0,0,0,0,833},{0,0,0,0,0,0,0,0,292},{0,0,0,0,0,0,0,0,664},{0,0,0,0,0,0,0,0,402},{0,0,0,0,0,0,0,0,217},{0,0,0,0,0,0,0,0,611},{0,0,0,0,0,0,0,0,618},{0,0,0,0,0,0,0,0,605},{0,0,0,0,0,0,0,0,574},{0,0,0,0,0,0,0,0,900},{0,0,0,0,0,0,0,0,427},{0,0,0,0,0,0,0,0,260},{0,0,0,0,0,0,0,0,327},{0,0,0,0,0,0,0,0,820},{0,0,0,0,0,0,0,0,842},{0,0,0,0,0,0,0,0,301},{0,0,0,0,0,0,0,0,504},{0,0,0,0,0,0,0,0,47},{0,0,0,0,0,0,0,0,771},{0,0,0,0,0,0,0,0,734},{0,0,0,0,0,0,0,0,680},{0,0,0,0,0,0,0,0,133},{0,0,0,0,0,0,0,0,340},{0,0,0,0,0,0,0,0,214},{0,0,0,0,0,0,0,0,42},{0,0,0,0,0,0,0,0,285},{0,0,0,0,0,0,0,0,228},{0,0,0,0,0,0,0,0,584},{0,0,0,0,0,0,0,0,568},{0,0,0,0,0,0,0,0,492},{0,0,0,0,0,0,0,0,701},{0,0,0,0,0,0,0,0,370},{0,0,0,0,0,0,0,0,723},{0,0,0,0,0,0,0,0,933},{0,0,0,0,0,0,0,0,28},{0,0,0,0,0,0,0,0,854},{0,0,0,0,0,0,0,0,35},{0,0,0,0,0,0,0,0,745},{0,0,0,0,0,0,0,0,411},{0,0,0,0,0,0,0,0,780},{0,0,0,0,0,0,0,0,765},{0,0,0,0,0,0,0,0,819},{0,0,0,0,0,0,0,0,663},{0,0,0,0,0,0,0,0,480},{0,0,0,0,0,0,0,0,122},{0,0,0,0,0,0,0,0,884},{0,0,0,0,0,0,0,0,754},{0,0,0,0,0,0,0,0,909},{0,0,0,0,0,0,0,0,293},{0,0,0,0,0,0,0,0,97},{0,0,0,0,0,0,0,0,717},{0,0,0,0,0,0,0,0,450},{0,0,0,0,0,0,0,0,561},{0,0,0,0,0,0,0,0,517},{0,0,0,0,0,0,0,0,226},{0,0,0,0,0,0,0,0,87},{0,0,0,0,0,0,0,0,330},{0,0,0,0,0,0,0,0,92},{0,0,0,0,0,0,0,0,52},{0,0,0,0,0,0,0,0,937},{0,0,0,0,0,0,0,0,906},{0,0,0,0,0,0,0,0,934},{0,0,0,0,0,0,0,0,712},{0,0,0,0,0,0,0,0,270},{0,0,0,0,0,0,0,0,888},{0,0,0,0,0,0,0,0,540},{0,0,0,0,0,0,0,0,233},{0,0,0,0,0,0,0,0,227},{0,0,0,0,0,0,0,0,277},{0,0,0,0,0,0,0,0,882},{0,0,0,0,0,0,0,0,769},{0,0,0,0,0,0,0,0,455},{0,0,0,0,0,0,0,0,267},{0,0,0,0,0,0,0,0,620},{0,0,0,0,0,0,0,0,639},{0,0,0,0,0,0,0,0,510},{0,0,0,0,0,0,0,0,400},{0,0,0,0,0,0,0,0,438},{0,0,0,0,0,0,0,0,254},{0,0,0,0,0,0,0,0,646},{0,0,0,0,0,0,0,0,114},{0,0,0,0,0,0,0,0,864},{0,0,0,0,0,0,0,0,742},{0,0,0,0,0,0,0,0,192},{0,0,0,0,0,0,0,0,179},{0,0,0,0,0,0,0,0,658},{0,0,0,0,0,0,0,0,416},{0,0,0,0,0,0,0,0,899},{0,0,0,0,0,0,0,0,572},{0,0,0,0,0,0,0,0,345},{0,0,0,0,0,0,0,0,347},{0,0,0,0,0,0,0,0,144},{0,0,0,0,0,0,0,0,733},{0,0,0,0,0,0,0,0,841},{0,0,0,0,0,0,0,0,651},{0,0,0,0,0,0,0,0,902},{0,0,0,0,0,0,0,0,363},{0,0,0,0,0,0,0,0,867},{0,0,0,0,0,0,0,0,928},{0,0,0,0,0,0,0,0,389},{0,0,0,0,0,0,0,0,243},{0,0,0,0,0,0,0,0,431},{0,0,0,0,0,0,0,0,189},{0,0,0,0,0,0,0,0,750},{0,0,0,0,0,0,0,0,616},{0,0,0,0,0,0,0,0,675},{0,0,0,0,0,0,0,0,669},{0,0,0,0,0,0,0,0,624},{0,0,0,0,0,0,0,0,143},{0,0,0,0,0,0,0,0,585},{0,0,0,0,0,0,0,0,575},{0,0,0,0,0,0,0,0,915},{0,0,0,0,0,0,0,0,346},{0,0,0,0,0,0,0,0,925},{0,0,0,0,0,0,0,0,255},{0,0,0,0,0,0,0,0,795},{0,0,0,0,0,0,0,0,604},{0,0,0,0,0,0,0,0,177},{0,0,0,0,0,0,0,0,509},{0,0,0,0,0,0,0,0,562},{0,0,0,0,0,0,0,0,626},{0,0,0,0,0,0,0,0,885},{0,0,0,0,0,0,0,0,208},{0,0,0,0,0,0,0,0,880},{0,0,0,0,0,0,0,0,615},{0,0,0,0,0,0,0,0,273},{0,0,0,0,0,0,0,0,107},{0,0,0,0,0,0,0,0,22},{0,0,0,0,0,0,0,0,155},{0,0,0,0,0,0,0,0,17},{0,0,0,0,0,0,0,0,868},{0,0,0,0,0,0,0,0,829},{0,0,0,0,0,0,0,0,124},{0,0,0,0,0,0,0,0,448},{0,0,0,0,0,0,0,0,242},{0,0,0,0,0,0,0,0,595},{0,0,0,0,0,0,0,0,247},{0,0,0,0,0,0,0,0,935},{0,0,0,0,0,0,0,0,558},{0,0,0,0,0,0,0,0,435},{0,0,0,0,0,0,0,0,76},{0,0,0,0,0,0,0,0,519},{0,0,0,0,0,0,0,0,474},{0,0,0,0,0,0,0,0,238},{0,0,0,0,0,0,0,0,302},{0,0,0,0,0,0,0,0,581},{0,0,0,0,0,0,0,0,929},{0,0,0,0,0,0,0,0,153},{0,0,0,0,0,0,0,0,759},{0,0,0,0,0,0,0,0,223},{0,0,0,0,0,0,0,0,70},{0,0,0,0,0,0,0,0,15},{0,0,0,0,0,0,0,0,74},{0,0,0,0,0,0,0,0,801},{0,0,0,0,0,0,0,0,390},{0,0,0,0,0,0,0,0,872},{0,0,0,0,0,0,0,0,451},{0,0,0,0,0,0,0,0,736},{0,0,0,0,0,0,0,0,774},{0,0,0,0,0,0,0,0,799},{0,0,0,0,0,0,0,0,523},{0,0,0,0,0,0,0,0,481},{0,0,0,0,0,0,0,0,221},{0,0,0,0,0,0,0,0,408},{0,0,0,0,0,0,0,0,940},{0,0,0,0,0,0,0,0,677},{0,0,0,0,0,0,0,0,145},{0,0,0,0,0,0,0,0,219},{0,0,0,0,0,0,0,0,496},{0,0,0,0,0,0,0,0,800},{0,0,0,0,0,0,0,0,636},{0,0,0,0,0,0,0,0,59},{0,0,0,0,0,0,0,0,314},{0,0,0,0,0,0,0,0,593},{0,0,0,0,0,0,0,0,440},{0,0,0,0,0,0,0,0,532},{0,0,0,0,0,0,0,0,290},{0,0,0,0,0,0,0,0,403},{0,0,0,0,0,0,0,0,263},{0,0,0,0,0,0,0,0,471},{0,0,0,0,0,0,0,0,725},{0,0,0,0,0,0,0,0,487},{0,0,0,0,0,0,0,0,505},{0,0,0,0,0,0,0,0,949},{0,0,0,0,0,0,0,0,825},{0,0,0,0,0,0,0,0,86},{0,0,0,0,0,0,0,0,463},{0,0,0,0,0,0,0,0,683},{0,0,0,0,0,0,0,0,855},{0,0,0,0,0,0,0,0,515},{0,0,0,0,0,0,0,0,72},{0,0,0,0,0,0,0,0,185},{0,0,0,0,0,0,0,0,235},{0,0,0,0,0,0,0,0,258},{0,0,0,0,0,0,0,0,19},{0,0,0,0,0,0,0,0,160},{0,0,0,0,0,0,0,0,730},{0,0,0,0,0,0,0,0,861},{0,0,0,0,0,0,0,0,632},{0,0,0,0,0,0,0,0,306},{0,0,0,0,0,0,0,0,643},{0,0,0,0,0,0,0,0,956},{0,0,0,0,0,0,0,0,139},{0,0,0,0,0,0,0,0,108},{0,0,0,0,0,0,0,0,104},{0,0,0,0,0,0,0,0,288},{0,0,0,0,0,0,0,0,793},{0,0,0,0,0,0,0,0,449},{0,0,0,0,0,0,0,0,266},{0,0,0,0,0,0,0,0,830},{0,0,0,0,0,0,0,0,871},{0,0,0,0,0,0,0,0,245},{0,0,0,0,0,0,0,0,5},{0,0,0,0,0,0,0,0,60},{0,0,0,0,0,0,0,0,341},{0,0,0,0,0,0,0,0,475},{0,0,0,0,0,0,0,0,360},{0,0,0,0,0,0,0,0,433},{0,0,0,0,0,0,0,0,625},{0,0,0,0,0,0,0,0,666},{0,0,0,0,0,0,0,0,187},{0,0,0,0,0,0,0,0,609},{0,0,0,0,0,0,0,0,168},{0,0,0,0,0,0,0,0,840},{0,0,0,0,0,0,0,0,691},{0,0,0,0,0,0,0,0,172},{0,0,0,0,0,0,0,0,141},{0,0,0,0,0,0,0,0,116},{0,0,0,0,0,0,0,0,832},{0,0,0,0,0,0,0,0,393},{0,0,0,0,0,0,0,0,46},{0,0,0,0,0,0,0,0,570},{0,0,0,0,0,0,0,0,351},{0,0,0,0,0,0,0,0,889},{0,0,0,0,0,0,0,0,88},{0,0,0,0,0,0,0,0,128},{0,0,0,0,0,0,0,0,367},{0,0,0,0,0,0,0,0,283},{0,0,0,0,0,0,0,0,848},{0,0,0,0,0,0,0,0,14},{0,0,0,0,0,0,0,0,590},{0,0,0,0,0,0,0,0,551},{0,0,0,0,0,0,0,0,839},{0,0,0,0,0,0,0,0,807},{0,0,0,0,0,0,0,0,275},{0,0,0,0,0,0,0,0,655},{0,0,0,0,0,0,0,0,18},{0,0,0,0,0,0,0,0,276},{0,0,0,0,0,0,0,0,939},{0,0,0,0,0,0,0,0,804},{0,0,0,0,0,0,0,0,436},{0,0,0,0,0,0,0,0,95},{0,0,0,0,0,0,0,0,813},{0,0,0,0,0,0,0,0,607},{0,0,0,0,0,0,0,0,477},{0,0,0,0,0,0,0,0,414},{0,0,0,0,0,0,0,0,619},{0,0,0,0,0,0,0,0,826},{0,0,0,0,0,0,0,0,67},{0,0,0,0,0,0,0,0,705},{0,0,0,0,0,0,0,0,805},{0,0,0,0,0,0,0,0,847},{0,0,0,0,0,0,0,0,484},{0,0,0,0,0,0,0,0,578},{0,0,0,0,0,0,0,0,482},{0,0,0,0,0,0,0,0,693},{0,0,0,0,0,0,0,0,495},{0,0,0,0,0,0,0,0,912},{0,0,0,0,0,0,0,0,30},{0,0,0,0,0,0,0,0,323},{0,0,0,0,0,0,0,0,246},{0,0,0,0,0,0,0,0,860},{0,0,0,0,0,0,0,0,29},{0,0,0,0,0,0,0,0,202},{0,0,0,0,0,0,0,0,349},{0,0,0,0,0,0,0,0,27},{0,0,0,0,0,0,0,0,420},{0,0,0,0,0,0,0,0,212},{0,0,0,0,0,0,0,0,96},{0,0,0,0,0,0,0,0,600},{0,0,0,0,0,0,0,0,752},{0,0,0,0,0,0,0,0,684},{0,0,0,0,0,0,0,0,344},{0,0,0,0,0,0,0,0,758},{0,0,0,0,0,0,0,0,406},{0,0,0,0,0,0,0,0,405},{0,0,0,0,0,0,0,0,901},{0,0,0,0,0,0,0,0,776},{0,0,0,0,0,0,0,0,682},{0,0,0,0,0,0,0,0,708},{0,0,0,0,0,0,0,0,786},{0,0,0,0,0,0,0,0,430},{0,0,0,0,0,0,0,0,589},{0,0,0,0,0,0,0,0,580},{0,0,0,0,0,0,0,0,732},{0,0,0,0,0,0,0,0,415},{0,0,0,0,0,0,0,0,318},{0,0,0,0,0,0,0,0,738},{0,0,0,0,0,0,0,0,58},{0,0,0,0,0,0,0,0,698},{0,0,0,0,0,0,0,0,64},{0,0,0,0,0,0,0,0,335},{0,0,0,0,0,0,0,0,371},{0,0,0,0,0,0,0,0,325},{0,0,0,0,0,0,0,0,629},{0,0,0,0,0,0,0,0,891},{0,0,0,0,0,0,0,0,355},{0,0,0,0,0,0,0,0,886},{0,0,0,0,0,0,0,0,706},{0,0,0,0,0,0,0,0,291},{0,0,0,0,0,0,0,0,638},{0,0,0,0,0,0,0,0,337},{0,0,0,0,0,0,0,0,159},{0,0,0,0,0,0,0,0,740},{0,0,0,0,0,0,0,0,265},{0,0,0,0,0,0,0,0,151},{0,0,0,0,0,0,0,0,24},{0,0,0,0,0,0,0,0,876},{0,0,0,0,0,0,0,0,700},{0,0,0,0,0,0,0,0,332},{0,0,0,0,0,0,0,0,154},{0,0,0,0,0,0,0,0,121},{0,0,0,0,0,0,0,0,215},{0,0,0,0,0,0,0,0,338},{0,0,0,0,0,0,0,0,182},{0,0,0,0,0,0,0,0,209},{0,0,0,0,0,0,0,0,828},{0,0,0,0,0,0,0,0,105},{0,0,0,0,0,0,0,0,836},{0,0,0,0,0,0,0,0,130},{0,0,0,0,0,0,0,0,486},{0,0,0,0,0,0,0,0,476},{0,0,0,0,0,0,0,0,910},{0,0,0,0,0,0,0,0,131},{0,0,0,0,0,0,0,0,893},{0,0,0,0,0,0,0,0,183},{0,0,0,0,0,0,0,0,953},{0,0,0,0,0,0,0,0,525},{0,0,0,0,0,0,0,0,395},{0,0,0,0,0,0,0,0,385},{0,0,0,0,0,0,0,0,556},{0,0,0,0,0,0,0,0,596},{0,0,0,0,0,0,0,0,388},{0,0,0,0,0,0,0,0,815},{0,0,0,0,0,0,0,0,439},{0,0,0,0,0,0,0,0,45},{0,0,0,0,0,0,0,0,722},{0,0,0,0,0,0,0,0,809},{0,0,0,0,0,0,0,0,863},{0,0,0,0,0,0,0,0,237},{0,0,0,0,0,0,0,0,516},{0,0,0,0,0,0,0,0,73},{0,0,0,0,0,0,0,0,927},{0,0,0,0,0,0,0,0,317},{0,0,0,0,0,0,0,0,352},{0,0,0,0,0,0,0,0,729},{0,0,0,0,0,0,0,0,782},{0,0,0,0,0,0,0,0,627},{0,0,0,0,0,0,0,0,461},{0,0,0,0,0,0,0,0,483},{0,0,0,0,0,0,0,0,775},{0,0,0,0,0,0,0,0,507},{0,0,0,0,0,0,0,0,494},{0,0,0,0,0,0,0,0,437},{0,0,0,0,0,0,0,0,792},{0,0,0,0,0,0,0,0,106},{0,0,0,0,0,0,0,0,425},{0,0,0,0,0,0,0,0,954},{0,0,0,0,0,0,0,0,613},{0,0,0,0,0,0,0,0,576},{0,0,0,0,0,0,0,0,555},{0,0,0,0,0,0,0,0,309},{0,0,0,0,0,0,0,0,297},{0,0,0,0,0,0,0,0,359},{0,0,0,0,0,0,0,0,113},{0,0,0,0,0,0,0,0,85},{0,0,0,0,0,0,0,0,83},{0,0,0,0,0,0,0,0,764},{0,0,0,0,0,0,0,0,623},{0,0,0,0,0,0,0,0,470},{0,0,0,0,0,0,0,0,660},{0,0,0,0,0,0,0,0,132},{0,0,0,0,0,0,0,0,387},{0,0,0,0,0,0,0,0,491},{0,0,0,0,0,0,0,0,887},{0,0,0,0,0,0,0,0,56},{0,0,0,0,0,0,0,0,545},{0,0,0,0,0,0,0,0,685},{0,0,0,0,0,0,0,0,645},{0,0,0,0,0,0,0,0,210},{0,0,0,0,0,0,0,0,478},{0,0,0,0,0,0,0,0,99},{0,0,0,0,0,0,0,0,62},{0,0,0,0,0,0,0,0,630},{0,0,0,0,0,0,0,0,503},{0,0,0,0,0,0,0,0,324},{0,0,0,0,0,0,0,0,358},{0,0,0,0,0,0,0,0,299},{0,0,0,0,0,0,0,0,466},{0,0,0,0,0,0,0,0,699},{0,0,0,0,0,0,0,0,173},{0,0,0,0,0,0,0,0,171},{0,0,0,0,0,0,0,0,945},{0,0,0,0,0,0,0,0,308},{0,0,0,0,0,0,0,0,536},{0,0,0,0,0,0,0,0,878},{0,0,0,0,0,0,0,0,224},{0,0,0,0,0,0,0,0,36},{0,0,0,0,0,0,0,0,614},{0,0,0,0,0,0,0,0,444},{0,0,0,0,0,0,0,0,394},{0,0,0,0,0,0,0,0,468},{0,0,0,0,0,0,0,0,372},{0,0,0,0,0,0,0,0,652},{0,0,0,0,0,0,0,0,649},{0,0,0,0,0,0,0,0,802},{0,0,0,0,0,0,0,0,881},{0,0,0,0,0,0,0,0,696},{0,0,0,0,0,0,0,0,279},{0,0,0,0,0,0,0,0,369},{0,0,0,0,0,0,0,0,726},{0,0,0,0,0,0,0,0,392},{0,0,0,0,0,0,0,0,597},{0,0,0,0,0,0,0,0,100},{0,0,0,0,0,0,0,0,109},{0,0,0,0,0,0,0,0,366},{0,0,0,0,0,0,0,0,456},{0,0,0,0,0,0,0,0,689},{0,0,0,0,0,0,0,0,816},{0,0,0,0,0,0,0,0,493},{0,0,0,0,0,0,0,0,348},{0,0,0,0,0,0,0,0,777},{0,0,0,0,0,0,0,0,146},{0,0,0,0,0,0,0,0,533},{0,0,0,0,0,0,0,0,583},{0,0,0,0,0,0,0,0,497},{0,0,0,0,0,0,0,0,331},{0,0,0,0,0,0,0,0,760},{0,0,0,0,0,0,0,0,281},{0,0,0,0,0,0,0,0,156},{0,0,0,0,0,0,0,0,111},{0,0,0,0,0,0,0,0,378},{0,0,0,0,0,0,0,0,68},{0,0,0,0,0,0,0,0,811},{0,0,0,0,0,0,0,0,373},{0,0,0,0,0,0,0,0,526},{0,0,0,0,0,0,0,0,289},{0,0,0,0,0,0,0,0,822},{0,0,0,0,0,0,0,0,94},{0,0,0,0,0,0,0,0,469},{0,0,0,0,0,0,0,0,110},{0,0,0,0,0,0,0,0,78},{0,0,0,0,0,0,0,0,904},{0,0,0,0,0,0,0,0,112},{0,0,0,0,0,0,0,0,950},{0,0,0,0,0,0,0,0,257},{0,0,0,0,0,0,0,0,43},{0,0,0,0,0,0,0,0,567},{0,0,0,0,0,0,0,0,382},{0,0,0,0,0,0,0,0,678},{0,0,0,0,0,0,0,0,834},{0,0,0,0,0,0,0,0,692},{0,0,0,0,0,0,0,0,57},{0}};
signed main()
{
// freopen("my.out","w",stdout);
pw[0]=1;
pw[1]=4;
For(i,2,8)pw[i]=pw[i-1]*4;
pw[1]=1;
now.resize(8);
For(i,0,(1<<8)-1)
if(__builtin_popcount(i)==3){
vi o;
For(j,0,7)if(i>>j&1)o.pb(j);
now[o[0]]=now[o[2]]='R';
now[o[1]]='K';
For(x,0,7) if(!(i>>x&1))
For(y,x+1,7) if(!(i>>y&1))
if((x%2)!=(y%2)) {
now[x]=now[y]='B';
vi tmp;
For(z,0,7) if(z!=x && z!=y && (!(i>>z&1)))
now[z]='N',tmp.pb(z);
for(int z:tmp) {
now[z]='Q';
str[n++]=now;
now[z]='N';
}
}
}
// cout<<n<<"\n";
shuffle(str,str+n,rnd);
For(i,0,n-1)
For(j,i,n-1){
int cnt=0;
For(k,0,7)if(str[i][k]==str[j][k])++cnt;
dis[i][j]=dis[j][i]=cnt;
}
// For(i,0,n-1){
// For(j,0,n-1) to[i][dis[i][j]].set(j);
// }
string OP; int ID;
string ans="RKRBBQNN";
int qcnt=0;
auto inx = [&](string s){
cout<<s<<endl;
++qcnt;
int x;cin>>x;return x;
int d=0; For(i,0,7)d+=(s[i]==ans[i]); return d;
};
// cerr<<"tot "<<tot<<'\n';
while(cin>>OP){
qcnt=0; // ans=str[_];
if(OP=="END")break;
cin>>ID;
// bint s; For(i,0,n-1)s.set(i);
// while(1){
// // cout<<"sc "<<s.count()<<"\n";
// if(s.count()==1){
// int x=s._Find_first();
// x=inx(str[x]);
// assert(x==8);break;
// }
// int x=go[s];
// x=inx(str[x]);
// if(x==8)break;
// s&=to[go[s]][x];
// }
int u=1;
while(1){
// cout<<"u: "<<u<<"\n";
int x=ch[u-1][8];
x=inx(str[x]);
if(x==8)break;
else u=ch[u-1][x];
assert(u);
}
// cerr<<"qcnt "<<qcnt<<"\n";
}
return 0;
}
/*
100
1 0 4
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 15068kb
input:
GAME 1 1 1 1 0 0 8 END
output:
QNBRKBNR RBKNNRBQ NQNRBKRB BRKNNBQR BRQNNKRB RKRBBQNN
result:
ok (c) correct after 1 tests, max moves 6 (1 test case)
Test #2:
score: 0
Accepted
time: 1ms
memory: 14576kb
input:
GAME 1 1 1 1 0 0 8 GAME 2 0 0 1 4 8 GAME 3 1 2 2 4 2 8 GAME 4 0 0 0 3 8 GAME 5 0 1 0 2 2 8 GAME 6 0 1 0 2 1 8 GAME 7 2 0 4 0 2 8 GAME 8 1 2 4 3 1 8 GAME 9 2 0 3 3 1 8 GAME 10 1 1 2 1 1 8 GAME 11 1 2 4 5 8 GAME 12 0 2 3 1 2 8 GAME 13 1 3 3 1 1 8 GAME 14 1 3 2 2 1 8 GAME 15 1 5 2 2 0 8 GAME 16 0 2 1 2...
output:
QNBRKBNR RBKNNRBQ NQNRBKRB BRKNNBQR BRQNNKRB RKRBBQNN QNBRKBNR BRQNNKRB NRQKBBNR NRKBBRQN RKRBBNQN QNBRKBNR RBKNNRBQ RBKNBQRN RKNQBRNB NRKBBRQN RKRBBNNQ QNBRKBNR BRQNNKRB NRQKBBNR RKNBBQNR RKRBQNBN QNBRKBNR BRQNNKRB NRQKBBNR RKNQBRNB NRKBBRQN RKRBNQBN QNBRKBNR BRQNNKRB NRQKBBNR RKNQBRNB NRKBBRQN RKR...
result:
ok (c) correct after 96 tests, max moves 6 (96 test cases)
Test #3:
score: 0
Accepted
time: 2ms
memory: 13892kb
input:
GAME 1 2 1 2 4 8 GAME 2 2 2 3 0 3 8 GAME 3 1 1 2 2 0 8 GAME 4 1 3 3 2 2 8 GAME 5 1 2 1 2 0 8 GAME 6 1 3 2 6 8 GAME 7 3 1 0 4 2 8 GAME 8 3 1 0 5 0 8 GAME 9 2 2 3 1 2 8 GAME 10 2 3 1 1 4 8 GAME 11 2 4 1 1 4 8 GAME 12 2 3 1 2 2 8 GAME 13 2 2 0 2 0 8 GAME 14 1 3 2 2 0 8 GAME 15 2 2 1 3 0 8 GAME 16 1 4 1...
output:
QNBRKBNR QBNRNKBR RKBQNBRN RKNQBRNB RKQBBNNR QNBRKBNR QBNRNKBR BRNBKNQR BRQNNKRB NRQKBBNR RKNBBQNR QNBRKBNR RBKNNRBQ NQNRBKRB BRKBNNRQ BRQNNKRB RKNBBNQR QNBRKBNR RBKNNRBQ NBRQKNBR NRQKBBNR BRQNNKRB RKQBNNBR QNBRKBNR RBKNNRBQ RBKNBQRN BRKBNNRQ BRQNNKRB RKNBQNBR QNBRKBNR RBKNNRBQ NBRQKNBR RKNBBQNR RKN...
result:
ok (c) correct after 96 tests, max moves 6 (96 test cases)
Test #4:
score: 0
Accepted
time: 1ms
memory: 15812kb
input:
GAME 1 4 2 2 1 4 8 GAME 2 2 1 2 1 4 8 GAME 3 3 4 5 8 GAME 4 3 2 1 2 2 8 GAME 5 2 1 0 4 2 8 GAME 6 1 1 4 2 5 8 GAME 7 3 1 4 2 3 8 GAME 8 2 2 1 0 4 8 GAME 9 2 3 2 0 2 8 GAME 10 2 4 3 0 2 8 GAME 11 1 2 1 3 2 8 GAME 12 1 3 2 1 3 8 GAME 13 1 1 0 2 8 GAME 14 0 2 1 1 5 8 GAME 15 1 2 1 6 2 8 GAME 16 2 0 3 3...
output:
QNBRKBNR QNBRNKRB RKNBBQNR BRNBKNQR NRKBBRQN QRKRBBNN QNBRKBNR QBNRNKBR RKBQNBRN RKNQBRNB NRQKBBNR NRKRBBQN QNBRKBNR NRBBKRNQ NRQKBBNR NRKRBBNQ QNBRKBNR NRBBKRNQ NBRQKNBR RKNBBQNR BRKNNBQR QRKRBNNB QNBRKBNR QBNRNKBR RKBQNBRN NRQKBBNR BRQNNKRB NRKRBQNB QNBRKBNR RBKNNRBQ NQNRBKRB RKNQBRNB NRKBBRQN NRK...
result:
ok (c) correct after 96 tests, max moves 6 (96 test cases)
Test #5:
score: 0
Accepted
time: 7ms
memory: 14828kb
input:
GAME 1 1 2 2 2 0 8 GAME 2 2 1 3 1 1 8 GAME 3 2 2 1 2 0 8 GAME 4 0 1 1 3 0 8 GAME 5 1 2 1 1 2 8 GAME 6 1 2 2 3 1 8 GAME 7 2 1 3 3 0 8 GAME 8 1 4 1 1 3 8 GAME 9 2 2 0 2 1 8 GAME 10 1 3 1 3 1 8 GAME 11 0 0 2 4 8 GAME 12 1 4 4 0 8 GAME 13 0 2 2 2 2 8 GAME 14 0 0 1 2 8 GAME 15 0 1 1 3 1 8 GAME 16 2 1 3 4...
output:
QNBRKBNR RBKNNRBQ RBKNBQRN RKNQBRNB BRQNNKRB RQNKRBBN QNBRKBNR QBNRNKBR RKBQNBRN RKNQBRNB BRQNNKRB RNQKRBBN QNBRKBNR QBNRNKBR BRNBKNQR RKNQBRNB NRKBBRQN RNNKRBBQ QNBRKBNR BRQNNKRB NRQKBBNR RKNQBRNB NRKBBRQN RQNKRNBB QNBRKBNR RBKNNRBQ RBKNBQRN BRKBNNRQ NRQKBBNR RNQKRNBB QNBRKBNR RBKNNRBQ RBKNBQRN RKN...
result:
ok (c) correct after 96 tests, max moves 6 (96 test cases)
Test #6:
score: 0
Accepted
time: 1ms
memory: 13900kb
input:
GAME 1 3 2 0 0 3 8 GAME 2 2 0 1 2 2 8 GAME 3 2 1 4 3 4 8 GAME 4 2 2 2 0 8 GAME 5 1 0 3 3 3 8 GAME 6 1 1 3 4 4 8 GAME 7 2 2 2 2 4 8 GAME 8 1 0 3 3 6 8 GAME 9 1 1 4 2 3 8 GAME 10 1 0 4 3 2 8 GAME 11 0 4 2 3 5 8 GAME 12 0 3 1 3 3 8 GAME 13 3 2 1 2 5 8 GAME 14 3 2 1 3 4 8 GAME 15 2 3 1 5 3 8 GAME 16 5 2...
output:
QNBRKBNR NRBBKRNQ NBRQKNBR RKNQBRNB BRQNNKRB QRBKNBRN QNBRKBNR QBNRNKBR RKBQRNNB BRKNNBQR BRQNNKRB NRBKQBRN QNBRKBNR QBNRNKBR RKBQNBRN BRQNNKRB NRQKBBNR NRBKNBRQ QNBRKBNR QBNRNKBR BRNBKNQR RQNBBKNR QRBKNNRB QNBRKBNR RBKNNRBQ NQNRBKRB BRQNNKRB NRQKBBNR NRBKQNRB QNBRKBNR RBKNNRBQ NQNRBKRB QNBRNKRB BRQ...
result:
ok (c) correct after 96 tests, max moves 6 (96 test cases)
Test #7:
score: 0
Accepted
time: 9ms
memory: 14856kb
input:
GAME 1 3 4 1 4 0 8 GAME 2 2 1 3 2 1 8 GAME 3 3 5 1 1 1 8 GAME 4 1 5 2 2 2 8 GAME 5 1 4 2 0 8 GAME 6 1 6 3 8 GAME 7 3 5 0 8 GAME 8 3 4 0 0 8 GAME 9 4 2 3 3 1 8 GAME 10 3 4 1 4 2 8 GAME 11 4 3 0 0 1 8 GAME 12 3 3 3 1 0 8 GAME 13 1 3 2 3 8 GAME 14 2 1 2 2 1 8 GAME 15 2 2 3 0 0 8 GAME 16 1 4 2 1 1 8 GAM...
output:
QNBRKBNR NRBBKRNQ NRQKBBNR RKNQBRNB BRQNNKRB RBBQKRNN QNBRKBNR QBNRNKBR RKBQNBRN RKNQBRNB BRQNNKRB RBBNKRQN QNBRKBNR NRBBKRNQ BRQNNKRB NRQKBBNR NRKBBRQN RBBNKRNQ QNBRKBNR RBKNNRBQ RKNQBRNB BRQNNKRB NRKBBRQN RBQNKRBN QNBRKBNR RBKNNRBQ RKNBBQNR BRKNNBQR RBNQKRBN QNBRKBNR RBKNNRBQ RKNQBRNB RBNNKRBQ QNB...
result:
ok (c) correct after 96 tests, max moves 6 (96 test cases)
Test #8:
score: 0
Accepted
time: 1ms
memory: 13912kb
input:
GAME 1 3 3 1 1 8 GAME 2 2 2 5 3 8 GAME 3 2 3 4 4 8 GAME 4 4 1 4 1 4 8 GAME 5 3 3 0 5 8 GAME 6 3 3 0 4 8 GAME 7 2 1 2 3 8 GAME 8 1 3 3 0 2 8 GAME 9 2 1 0 1 2 8 GAME 10 2 0 1 1 3 8 GAME 11 2 0 0 1 4 8 GAME 12 3 5 1 1 2 8 GAME 13 2 0 2 3 1 8 GAME 14 3 3 2 1 1 8 GAME 15 2 0 1 3 3 8 GAME 16 2 3 2 0 1 8 G...
output:
QNBRKBNR NRBBKRNQ QNBRNKRB RKNQBRNB QRNBKNBR QNBRKBNR QBNRNKBR BRNBKNQR NRKBBRQN NRQBKNBR QNBRKBNR QBNRNKBR NBBRKQNR RKNBBQNR NRNBKQBR QNBRKBNR QNBRNKRB BRNBKNQR NRKBBRQN BRKNNBQR QRNNKBBR QNBRKBNR NRBBKRNQ QNBRNKRB NRQKBBNR NRQNKBBR QNBRKBNR NRBBKRNQ QNBRNKRB NRQKBBNR NRNQKBBR QNBRKBNR QBNRNKBR RKB...
result:
ok (c) correct after 96 tests, max moves 6 (96 test cases)
Test #9:
score: 0
Accepted
time: 8ms
memory: 15652kb
input:
GAME 1 6 1 0 8 GAME 2 5 0 1 1 8 GAME 3 4 2 1 2 2 8 GAME 4 4 2 2 4 0 8 GAME 5 3 2 6 1 8 GAME 6 3 2 5 0 8 GAME 7 8 GAME 8 6 2 4 8 GAME 9 6 3 0 8 GAME 10 6 2 2 8 GAME 11 4 1 3 2 1 8 GAME 12 5 1 2 4 8 GAME 13 1 3 2 1 1 8 GAME 14 1 3 1 5 8 GAME 15 1 5 1 0 4 8 GAME 16 0 4 2 1 2 8 GAME 17 0 2 5 2 8 GAME 18...
output:
QNBRKBNR BRKNNBQR BRQNNKRB QBBRKNNR QNBRKBNR BRQNNKRB NRKBBRQN RKNQBRNB NBBRKQNR QNBRKBNR QNBRNKRB RKNBBQNR BRKNNBQR NRQKBBNR NBBRKNQR QNBRKBNR QNBRNKRB RKNBBQNR BRNBKNQR NRKBBRQN QBNRKNBR QNBRKBNR NRBBKRNQ NBRQKNBR NRKBBRQN NBQRKNBR QNBRKBNR NRBBKRNQ NBRQKNBR BRQNNKRB NBNRKQBR QNBRKBNR QNBRKBNR BRK...
result:
ok (c) correct after 96 tests, max moves 6 (96 test cases)
Test #10:
score: 0
Accepted
time: 1ms
memory: 14736kb
input:
GAME 1 2 4 3 2 0 8 GAME 2 2 3 3 2 3 8 GAME 3 1 3 3 1 4 8 GAME 4 2 3 2 5 2 8 GAME 5 3 2 2 2 1 8 GAME 6 2 3 1 4 2 8 GAME 7 3 1 2 3 2 8 GAME 8 2 3 4 3 4 8 GAME 9 1 2 3 3 2 8 GAME 10 2 6 0 3 8 GAME 11 1 3 6 2 8 GAME 12 1 3 5 2 8 GAME 13 4 3 4 1 2 8 GAME 14 2 2 2 6 8 GAME 15 2 2 3 1 4 8 GAME 16 3 1 4 2 1...
output:
QNBRKBNR QBNRNKBR BRQNNKRB RKNBBQNR NRKBBRQN BBRQNKNR QNBRKBNR QBNRNKBR NBBRKQNR NRQKBBNR BRQNNKRB BBRNQKNR QNBRKBNR RBKNNRBQ NBRQKNBR NRQKBBNR BRQNNKRB BBRNNKQR QNBRKBNR QBNRNKBR NBBRKQNR RQNBBKNR NRQKBBNR BQRBNKNR QNBRKBNR NRBBKRNQ NBRQKNBR NRQKBBNR NRKBBRQN BNRBQKNR QNBRKBNR QBNRNKBR NBBRKQNR BRN...
result:
ok (c) correct after 96 tests, max moves 6 (96 test cases)
Test #11:
score: 0
Accepted
time: 1ms
memory: 16004kb
input:
GAME 1 1 1 3 0 8 GAME 2 2 1 1 3 1 8 GAME 3 2 2 3 0 2 8 GAME 4 2 2 2 5 8 GAME 5 3 0 1 1 4 8 GAME 6 3 0 2 4 8 GAME 7 1 1 0 4 8 GAME 8 1 0 1 2 2 8 GAME 9 1 1 1 4 3 8 GAME 10 2 2 3 5 8 GAME 11 2 3 1 4 1 8 GAME 12 2 2 4 5 1 8 GAME 13 3 3 3 2 2 8 GAME 14 2 1 1 5 8 GAME 15 2 2 3 2 3 8 GAME 16 4 3 2 5 8 GAM...
output:
QNBRKBNR RBKNNRBQ NQNRBKRB QNBRNKRB RQNBBNKR QNBRKBNR QBNRNKBR RKBQNBRN QRBBKNNR BRQNNKRB RNQBBNKR QNBRKBNR QBNRNKBR BRNBKNQR BRQNNKRB NRQKBBNR RNNBBQKR QNBRKBNR QBNRNKBR BRNBKNQR RQNBBKNR RQNNBBKR QNBRKBNR NRBBKRNQ BRNKRBNQ QNBRNKRB NRQKBBNR RNQNBBKR QNBRKBNR NRBBKRNQ BRNKRBNQ RKNQBRNB RNNQBBKR QNB...
result:
ok (c) correct after 96 tests, max moves 6 (96 test cases)
Extra Test:
score: 0
Extra Test Passed