QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#272566#7531. Hacking the ProjectvxvAC ✓6ms4156kbC++20988b2023-12-02 17:51:372023-12-02 17:51:38

Judging History

你现在查看的是最新测评结果

  • [2023-12-02 17:51:38]
  • 评测
  • 测评结果:AC
  • 用时:6ms
  • 内存:4156kb
  • [2023-12-02 17:51:37]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int M = 26;
int a[M], mask, N;
vector<string> out[M];
char s[17];string S;
void one_case(){
	scanf("%d",&N);
	memset(a,0,sizeof(a));
	mask = 0;
	for(int i=0; i<M; i++)out[i].clear();
	while(true){
		bool end = true;
		for(int i=0; i<M; i++){
			if(mask&(1<<i))continue;

			int tot = 0;
			for(int j=0; j<M; j++)tot += a[j];
			if(tot == N)return;

			int nex = min(a[i] == 0 ? 1 : a[i] * 2, N - (tot - a[i]));

			printf("query %c %d\n",char(i+'a'), nex);fflush(stdout);

			int res;
			scanf("%d",&res);
			if(res < nex)mask |= 1<<i;else
				end = false;
			a[i] = res;

			out[i].clear();
			while(res--){
				scanf("%s", s);
				S = s;
				out[i].push_back(S);
			}
		}
		if(end)break;
	}
}
int main(){
	int _;
	for(scanf("%d",&_); _--;){
		one_case();
		printf("answer");
		for(int i=0; i<M; i++)for(string&X : out[i])printf(" %s",X.c_str());puts("");fflush(stdout);
	}
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 4080kb

input:

1
4
1 aaa
0
1 cxyxy
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2 aaa aba
2 cxyxy czzzz

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query c 2
answer aaa aba cxyxy...

result:

ok Ok in 30 k

Test #2:

score: 0
Accepted
time: 2ms
memory: 3836kb

input:

5
1000
1 a
1 b
1 c
1 d
1 e
1 f
1 g
1 h
1 i
1 j
1 k
1 l
1 m
1 n
1 o
1 p
1 q
1 r
1 s
1 t
1 u
1 v
1 w
1 x
1 y
1 z
2 a aajm
2 b baaxqvzig
2 c cabvmqwafv
2 d dagwdwxsuf
2 e eai
2 f faf
2 g gawqvlr
2 h hah
2 i iafjb
2 j jbda
2 k kadhcsccxy
2 l lalkbnjnw
2 m ma
2 n nagfevsc
2 o oa
2 p pbtamz
2 q qaermsps
2...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 3153 k

Test #3:

score: 0
Accepted
time: 6ms
memory: 3860kb

input:

5
1000
1 acbd
1 bayaeq
1 cbok
1 daevi
1 ebaavj
1 fa
1 gawqvlrb
1 hahc
1 ia
1 jafdktn
1 kat
1 lb
1 majph
1 natbaww
1 oampo
1 patmdlhmqe
1 qactfx
1 raca
1 sa
1 tadtninwc
1 ubjcmblwko
1 va
1 wahxylc
1 xaaacqrs
1 yaovqb
1 zauu
2 acbd acgts
2 bayaeq bbfomoiaww
2 cbok cbszcep
2 daevi daserffcvk
2 ebaavj e...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 3247 k

Test #4:

score: 0
Accepted
time: 2ms
memory: 3936kb

input:

5
1000
1 aaxqvzig
1 bcfsesgfb
1 caayipsojl
1 dbjifnrvw
1 eamumksc
1 fagppcoil
1 gamb
1 hbdfqbvc
1 iafmvkb
1 jamwvtxfqf
1 kaxsxwktfc
1 lahkprf
1 mcci
1 nbnsx
1 oaquu
1 pbminx
1 qacbdxw
1 rasz
1 sam
1 taurglbgm
1 ubiwqjdjh
1 vaex
1 wafvm
1 xavemciuqm
1 ybug
1 zapun
2 aaxqvzig abbaep
2 bcfsesgfb bcvoyp...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 3206 k

Test #5:

score: 0
Accepted
time: 4ms
memory: 3876kb

input:

5
1000
1 a
1 b
1 c
1 d
1 e
1 f
1 g
1 h
1 i
1 j
1 k
1 l
1 m
1 n
1 o
1 p
1 qbgvgljhv
1 r
1 s
1 t
1 u
1 v
1 w
1 x
1 y
1 z
2 a aalilyz
2 b bbmigtq
2 c cafbx
2 d dbexsgly
2 e eb
2 f fafq
2 g gawqvlr
2 h hacvd
2 i iabzbrs
2 j jaaws
2 k ka
2 l lar
2 m mamklrwlz
2 n na
2 o oadm
2 p pahfbkew
2 qbgvgljhv qbkp...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 3046 k

Test #6:

score: 0
Accepted
time: 2ms
memory: 3824kb

input:

5
1000
1 abvmqw
1 bbmig
1 canwpofl
1 db
1 eaonqkrt
1 fa
1 ga
1 hai
1 iadtlc
1 jaopve
1 kcamv
1 lahkpr
1 ma
1 nagfevscf
1 oandfqjam
1 pa
1 qa
1 rahu
1 sa
1 ta
1 ua
1 vbrpp
1 waznbuwen
1 xav
1 ya
1 zcl
2 abvmqw acgt
2 bbmig bbnxbhq
2 canwpofl casinzxcd
2 db dbc
2 eaonqkrt ebkjhe
2 fa faeqqoj
2 ga gaor...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 3179 k

Test #7:

score: 0
Accepted
time: 0ms
memory: 3876kb

input:

5
1000
1 aavfeg
1 bahnzdwto
1 cafb
1 datx
1 eatdzw
1 fafqlbo
1 ganel
1 hahci
1 ibcbbmzbi
1 jcvhdec
1 kampswf
1 lalkb
1 maixwsq
1 nacxwl
1 oapjzkz
1 pcuuimo
1 qalswxs
1 raehzdlt
1 sac
1 tabvkspw
1 uaibgyc
1 vaadr
1 wbqjv
1 xbhqj
1 yaovqbivu
1 zbnduoa
2 aavfeg abogkwk
2 bahnzdwto bay
2 cafb cakr
2 dat...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 3103 k

Test #8:

score: 0
Accepted
time: 1ms
memory: 3868kb

input:

5
1000
1 a
1 b
1 c
1 d
1 e
1 f
1 g
1 h
1 i
1 j
1 k
1 l
1 m
1 n
1 o
1 p
1 q
1 r
1 s
1 t
1 u
1 v
1 w
1 x
1 y
1 z
2 a aaac
2 b bbee
2 c caoc
2 d dbyfw
2 e ebsc
2 f fafqlb
2 g gaxd
2 h haoz
2 i ia
2 j jaaws
2 k kbblvnm
2 l larjo
2 m mambzus
2 n nbk
2 o oapkqed
2 p pa
2 q qactf
2 r rawgym
2 s sbgrsfne
2 ...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 3138 k

Test #9:

score: 0
Accepted
time: 5ms
memory: 3816kb

input:

5
1000
1 aaciqgnc
1 baapy
1 cab
1 dbfancn
1 ea
1 fc
1 ga
1 ha
1 iabzbrsk
1 jabwu
1 kaflgk
1 laqsal
1 mbpdtwnz
1 na
1 oag
1 pas
1 qaa
1 rawm
1 sa
1 tabvksp
1 uaggxcvb
1 vals
1 wafvm
1 xasca
1 ybaa
1 zaf
2 aaciqgnc aawtbc
2 baapy bbqkfl
2 cab caqj
2 dbfancn dczatf
2 ea eanf
2 fc fcvkecq
2 ga gaaitm
2 ...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 3146 k

Test #10:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

5
1000
1 aagxaa
1 bbmifnu
1 cbbm
1 daskq
1 eai
1 faf
1 gaa
1 haia
1 iaaiso
1 jaqso
1 katjmppr
1 laiiymt
1 maqzqi
1 namdjxn
1 oaci
1 pahfbke
1 qaavfe
1 rafbqe
1 sac
1 tawoxi
1 ualgf
1 vbr
1 wazhbje
1 xabq
1 yaeqv
1 zagrf
2 aagxaa abjc
2 bbmifnu bccu
2 cbbm cciab
2 daskq datx
2 eai ebye
2 faf failjab
...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 3121 k

Test #11:

score: 0
Accepted
time: 4ms
memory: 3872kb

input:

5
1000
1 aadbd
1 baczgkb
1 cadadn
1 daidcgg
1 eaaju
1 faalpahgag
1 gandpacjc
1 habek
1 iabahoj
1 jaaczjnicf
1 kaafyf
1 ladsdfa
1 maclk
1 nadgm
1 oblarbs
1 paadzha
1 qaddagbumk
1 racxzzj
1 saapzcab
1 tadadva
1 uajbkyzec
1 vddbkd
1 waxad
1 xalfddkhc
1 ybddfgha
1 zaaagkfan
2 aadbd aadbg
2 baczgkb baddd...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 2897 k

Test #12:

score: 0
Accepted
time: 5ms
memory: 3892kb

input:

5
1000
1 aabwpote
1 baaadas
1 caaiynpab
1 daaibptcfz
1 eaakzcz
1 faadbmm
1 gabaxalfd
1 halekcdrh
1 iaccfnzefc
1 jaakcds
1 kaafyfih
1 lalbdehaai
1 mafaicbje
1 nagzmozxfj
1 oazfjzio
1 paadzhadi
1 qacoxksddj
1 raaxefbfei
1 sajuqdga
1 tabnafaffm
1 uaccocdien
1 vcmdhjnazb
1 wgdzachyad
1 xabezqcfu
1 ybfwb...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 2969 k

Test #13:

score: 0
Accepted
time: 2ms
memory: 3876kb

input:

5
1000
1 aaaac
1 baaad
1 caadidkda
1 daaeatmaj
1 eaajdabctd
1 fabzahdka
1 gaanfdadh
1 hacmga
1 iaadcahbfa
1 jaabategda
1 kabadcaos
1 lacbbcafd
1 maaqucne
1 nabfn
1 oaaddahaf
1 pabad
1 qacdf
1 rbbbr
1 saacbtcdga
1 tbglccfmib
1 uaajsuqei
1 vfgghpcccl
1 waaafidkku
1 xbiaedch
1 yagabwal
1 zabbnemecd
2 a...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 2758 k

Test #14:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

5
1000
1 aabbhcc
1 baacaedab
1 caadqibaca
1 daakiclage
1 eaaifebma
1 fabcaral
1 gaadtacbbh
1 habbbaadkj
1 iacbeqcaca
1 jaaboabfnb
1 kabbdbacc
1 labhcvbdb
1 mahdbagim
1 nagdajg
1 oaapabadn
1 paaieclbme
1 qacdfigpa
1 rbbdfbhlhe
1 sbecbbdh
1 tckfamkq
1 uaoaebf
1 vaafbnbbn
1 wcepvaeja
1 xbiaedchgk
1 yaa...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 2843 k

Test #15:

score: 0
Accepted
time: 4ms
memory: 4156kb

input:

5
1000
1 aaaaaibb
1 baaaf
1 caaaelpu
1 daaaibs
1 eaaambc
1 faahh
1 gaabbbicei
1 haadca
1 iaakgfad
1 jabafae
1 kaacfaqbr
1 lacdql
1 maadzb
1 naeebjccjb
1 oabagabgs
1 pbfacb
1 qcabxlcbsa
1 rccaadeda
1 sbafahibd
1 taadaaab
1 uicicchs
0
1 wfeaa
0
0
1 zcefd
2 aaaaaibb aaabaa
2 baaaf baabk
2 caaaelpu caaa...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 2774 k

Test #16:

score: 0
Accepted
time: 3ms
memory: 3880kb

input:

5
1000
1 aaabfdi
1 baaadceai
1 caacaeda
1 daaabaolf
1 eaaaagb
1 faaegdebac
1 gabbehbb
1 hadbcee
1 iaabeeeba
1 jabcgbbhdb
1 kabgfkd
1 lafdbpaj
1 maadzbambi
1 naeebjcc
1 oaadkbc
1 pabegcme
1 qaacbtcdga
1 rbbbaedbg
1 sajeecbbaf
1 tcibfaid
1 ufajeccbh
1 vbesacjaa
1 wadbffc
0
1 ycaavaeeab
1 zdaebaab
2 aa...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 2857 k

Test #17:

score: 0
Accepted
time: 0ms
memory: 4108kb

input:

5
1000
1 aaaab
1 baaaccaoe
1 caaaaie
1 daabefdc
1 eaaacib
1 faaaadb
1 gaadflgi
1 haaba
1 iaababicb
1 jaaeeab
1 kadaafeic
1 laaabbaaa
1 madbabddbm
1 naeebbeccc
1 obbabdae
1 pnaeb
1 qcgdaeea
1 racbbhaif
1 sbcmcdcec
1 taadaaab
1 ubcai
1 vdcdacaad
0
0
0
0
2 aaaab aaaad
2 baaaccaoe baaacgagje
2 caaaaie c...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 2891 k

Test #18:

score: 0
Accepted
time: 0ms
memory: 3880kb

input:

5
1000
1 aaaadbaab
1 baaadagga
1 caaaacbaca
1 daabafhaah
1 eaacbae
1 faagcbbdf
1 gaabcgada
1 haabaaadh
1 iaabbca
1 jaaadlh
1 kabbcbcaa
1 laaahckga
1 maabcacgc
1 nacblad
1 oaeebbec
1 pabbdbc
1 qdgfccaafb
1 rdaqiabla
1 sdabacc
0
1 ucfebcfd
0
0
0
0
0
2 aaaadbaab aaaagbae
2 baaadagga baaafcbfe
2 caaaacb...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 2964 k

Test #19:

score: 0
Accepted
time: 2ms
memory: 3956kb

input:

5
1000
1 aaaaaedd
1 baaaaaaaaa
1 caaaababc
1 daaaaaddb
1 eaaagbbbc
1 faaaaaaac
1 gaahdb
1 haaaaacj
1 iaaabbea
1 jaaabbccde
1 kaabbdc
1 labjeca
1 macaae
1 nebaae
0
1 pabca
1 qddaa
1 rcbedaead
0
0
0
0
0
0
0
0
2 aaaaaedd aaaab
2 baaaaaaaaa baaaab
2 caaaababc caaaaeabbc
2 daaaaaddb daaaaccab
2 eaaagbbbc...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 2829 k

Test #20:

score: 0
Accepted
time: 4ms
memory: 3816kb

input:

5
1000
1 aaaaaaakf
1 baaaaad
1 caaaacbaca
1 daaaaaddb
1 eaaaabc
1 faaaebshf
1 gaadcegb
1 haaaajbibd
1 iabeaad
1 jaabbaaab
1 kbadabdaab
1 lacadba
1 mbabbakaa
1 naggaba
1 ogafahaa
1 pbiaaba
1 qaacbjjbad
1 rcbedae
0
0
0
0
1 wbafabbabj
0
0
0
2 aaaaaaakf aaaaaadda
2 baaaaad baaaaaka
2 caaaacbaca caaaaiea...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query d 2
...

result:

ok Ok in 2805 k

Test #21:

score: 0
Accepted
time: 1ms
memory: 3852kb

input:

1
1000
0
1 bagaoguesy
0
0
0
0
0
0
1 iadwiuhuul
0
0
0
1 mahzatptrv
0
0
0
0
0
0
0
0
1 vaaairmyxt
0
0
0
0
2 bagaoguesy bajdjjxkus
2 iadwiuhuul ianqxstpto
2 mahzatptrv makynpckdo
2 vaaairmyxt vaaofrhqxr
4 bagaoguesy bajdjjxkus bamxlzqrbg baqstjbgkd
4 iadwiuhuul ianqxstpto ibahquujsw ibgfvqubqm
4 mahzatp...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query b 2
query i 2
query m 2
query v 2
...

result:

ok Ok in 2054 k

Test #22:

score: 0
Accepted
time: 0ms
memory: 4076kb

input:

1
1000
0
1 babuzeiopu
0
1 dagtaojwhl
0
1 fbgxkameup
0
0
0
0
0
0
0
0
0
1 paaaieotlw
0
0
0
0
0
1 vachxbrzly
1 wafzksjmam
0
0
1 zahhxshcmo
2 babuzeiopu baekaudviq
2 dagtaojwhl dajhtkoabk
2 fbgxkameup fbhagpmkuk
2 paaaieotlw pegnpjocgh
2 vachxbrzly vacjfetyay
2 wafzksjmam waghiwipzo
2 zahhxshcmo zaqqgqg...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query b 2
query d 2
query f 2
query p 2
...

result:

ok Ok in 2476 k

Test #23:

score: 0
Accepted
time: 1ms
memory: 3900kb

input:

1
1000
1 aahisutiku
1 bahhntxaqw
1 cagvieqsrk
0
1 ezbdevmmuz
0
1 gamosyaoqh
0
1 iaahshwshh
0
1 kabwxethzl
1 lwewhacibc
1 marnodzhmh
1 nyatsjbyaw
1 oljzvcwraw
1 paocelsrtf
1 qirczapbrn
0
0
0
1 udmvahtwrz
0
1 wbgipkjokc
0
1 yhpobikkis
1 zfqomqbyrn
2 aahisutiku aakxjvgzfg
2 bahhntxaqw bajmbowiel
2 cagv...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query e 2
...

result:

ok Ok in 3366 k

Test #24:

score: 0
Accepted
time: 0ms
memory: 3844kb

input:

1
1000
1 adwrfxvqth
1 bariprplmb
1 caafsnhpjh
0
1 eacihotcds
1 fdhkizdgqc
1 gajmudviom
0
1 iabfpdqtzo
1 jbusjfkthc
0
0
0
0
0
0
0
0
1 sabfgyrvaf
0
1 uagjiicsdt
1 vaohtnrgbd
0
1 xcclrzlnal
0
1 zaglzersoz
2 adwrfxvqth akykuvdgif
2 bariprplmb bbdehlqkie
2 caafsnhpjh cdjasccgme
2 eacihotcds eadptbssdo
2 ...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query e 2
...

result:

ok Ok in 2267 k

Test #25:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

1
1000
0
0
1 cbepuznjbc
0
0
0
0
0
0
1 jangnpiymj
0
1 laackwvqzq
1 manykzslud
0
0
1 pabpwglhtj
1 qacjadcsvn
0
0
1 tadlrvhlhp
0
0
0
0
0
1 ztrxfgazou
2 cbepuznjbc cbilnwqszh
2 jangnpiymj janttuwqtu
2 laackwvqzq laahyqzspp
2 manykzslud mbcjwdjakg
2 pabpwglhtj paexcbvtxo
2 qacjadcsvn qagreblovp
2 tadlrvh...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query c 2
query j 2
query l 2
query m 2
...

result:

ok Ok in 2041 k

Test #26:

score: 0
Accepted
time: 0ms
memory: 4104kb

input:

1
1000
0
1 babktgvctu
1 cagxvcghvb
0
0
0
0
0
0
0
0
0
0
0
1 oaeggfpfky
1 pabuhwripc
0
0
1 swmcktejny
1 tbkmpmsadq
0
0
1 waakcwsjnz
0
0
0
2 babktgvctu bacckliudy
2 cagxvcghvb cbaplkbhaj
1 oaeggfpfky
2 pabuhwripc pacecpvmgs
1 swmcktejny
2 tbkmpmsadq tbultwytlf
2 waakcwsjnz wafbaoejrx
4 babktgvctu bacck...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query b 2
query c 2
query o 2
query p 2
...

result:

ok Ok in 3086 k

Test #27:

score: 0
Accepted
time: 1ms
memory: 4072kb

input:

1
1000
1 anpmcjtvhc
1 babqiytdti
1 cjqrgxmiml
0
1 eaadnyfyke
0
0
0
1 ifocrxtzza
0
0
0
0
0
0
1 pmnswpiniq
1 qabuziwiox
0
1 sbqxjqassk
0
0
1 vikogcgnag
0
0
0
1 zirsnlbvls
1 anpmcjtvhc
2 babqiytdti backovxsdu
1 cjqrgxmiml
2 eaadnyfyke eadqkbuzri
1 ifocrxtzza
1 pmnswpiniq
2 qabuziwiox qaqobkldgj
1 sbqxj...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query b 2
query c 2
query e 2
...

result:

ok Ok in 2921 k

Test #28:

score: 0
Accepted
time: 1ms
memory: 3824kb

input:

1
1000
0
0
1 cadaytkjkd
0
1 eadawukitu
0
1 gexwsftlku
0
0
0
1 kafjpejnpm
1 laascsiodw
1 mjgqhorzag
0
0
0
0
0
0
0
1 uaiipebmpd
0
0
0
0
0
2 cadaytkjkd cafzgsqgfu
2 eadawukitu eadgnhhaqo
1 gexwsftlku
2 kafjpejnpm kbdgflymdk
2 laascsiodw laceyfdivb
2 mjgqhorzag mklrsiutur
2 uaiipebmpd uauxnwoycs
4 caday...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query c 2
query e 2
query g 2
query k 2
...

result:

ok Ok in 3017 k

Test #29:

score: 0
Accepted
time: 0ms
memory: 3884kb

input:

1
1000
0
1 bbebxtglxm
0
0
0
0
0
0
1 iabmdmtywa
0
1 kdcgdixwiq
1 lbewsywptj
0
0
0
0
1 qaafeyqakh
0
1 souqzkmxem
0
0
0
1 wakazlfhzc
1 xaaebcjrjz
0
0
2 bbebxtglxm bdzpwcbwvo
2 iabmdmtywa iaemjvkjdy
2 kdcgdixwiq kmpokdfdqg
2 lbewsywptj lcntwvsqkm
2 qaafeyqakh qabhzkdpdi
1 souqzkmxem
2 wakazlfhzc wakidqp...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query b 2
query i 2
query k 2
query l 2
...

result:

ok Ok in 3093 k

Test #30:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

1
1000
0
0
0
1 dkthhcxrcq
1 eakgfiehic
1 fcikyttfvo
0
1 hnmzfakzkd
1 irbxwbzaum
1 jacmdavkix
1 kalkbyofhq
1 lbzshgmvns
1 mmirvzmcyb
0
1 oaakjxuowo
1 pwunbqnxby
0
0
1 sltalhnakx
1 tchuyuygic
1 ulhvczdptv
1 vagpgxcpik
0
0
1 yacaoxxjjb
1 znlumvtxph
1 dkthhcxrcq
2 eakgfiehic eaqjfngdky
1 fcikyttfvo
1 hn...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query d 2
query e 2
query f 2
query h 2
...

result:

ok Ok in 2137 k

Test #31:

score: 0
Accepted
time: 3ms
memory: 3880kb

input:

5
1000
1 aaaiqwexnq
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2 aaaiqwexnq aadjcquqdq
4 aaaiqwexnq aadjcquqdq aafaldvvzr aaflmsydwu
8 aaaiqwexnq aadjcquqdq aafaldvvzr aaflmsydwu aafwzaqmhr aafypzoakd aahtirtmve aaitvirspt
16 aaaiqwexnq aadjcquqdq aafaldvvzr aaflmsydwu aafwzaqmhr aafypzoakd a...

output:

query a 1
query b 1
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query k 1
query l 1
query m 1
query n 1
query o 1
query p 1
query q 1
query r 1
query s 1
query t 1
query u 1
query v 1
query w 1
query x 1
query y 1
query z 1
query a 2
query a 4
query a 8
query a 16...

result:

ok Ok in 2460 k