QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#654160#7531. Hacking the Projectucup-team3519WA 17ms3948kbC++171.4kb2024-10-18 21:10:402024-10-18 21:10:42

Judging History

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

  • [2024-10-18 21:10:42]
  • 评测
  • 测评结果:WA
  • 用时:17ms
  • 内存:3948kb
  • [2024-10-18 21:10:40]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define V vector
#define all0(x) (x).begin(),(x).end()
#define all1(x) (x).begin()+1,(x).end()
#define pb push_back
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define cin std::cin
#define cout std::cout
typedef long long LL;
typedef pair<int, int> pi;
typedef pair<LL, LL> pl;

//const int MN = 2e5 + 20;
const int INF = 2e9 + 1000;
const LL INFLL = 8e18 + 1000;
mt19937 mrand(chrono::steady_clock().now().time_since_epoch().count());
//模板区域~~~~~~~

//模板结束~~~~~~~

void solve() {
    V<int> a{1, 3, 7, 16, 34, 69, 133, 243, 418, 665, 939, 1041};
    int n; cin >> n;
    set<string> ans;

    auto query = [&](char c, int x) -> int {
        cout << "query " << c << " " << x << endl;
        int k; cin >> k;
        for(int i = 1; i <= k; i++) {
            string s; cin >> s;
            ans.insert(s);
        }
        return k;
    };

    for(char x = 'a'; x <= 'z'; x++) {
        for(int i = 0; ; i++) {
            int now = a[i];
            int t = query(x, now);
            if(t < now) break;
        }
    }
    cout << "answer ";
    for(auto s : ans) cout << s << " ";
    cout << endl;

    
}

int32_t main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t = 1;
    cin >> t;
    while (t--) 
    solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3832kb

input:

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

output:

query a 1
query a 3
query b 1
query c 1
query c 3
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
answer aaa aba cxyxy...

result:

ok Ok in 32 k

Test #2:

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

input:

5
1000
1 a
3 a aajm aavfegkci
7 a aajm aavfegkci aavj abjc abnxwsy abzbr
16 a aajm aavfegkci aavj abjc abnxwsy abzbr acvd adrvb af afbxpytbe afl afwsjfu aigwxskrks aimpdesf ajbq
34 a aajm aavfegkci aavj abjc abnxwsy abzbr acvd adrvb af afbxpytbe afl afwsjfu aigwxskrks aimpdesf ajbq alsqmc alswxsm an...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
query e 1
query e 3
query e 7
query e 16
query e...

result:

ok Ok in 3173 k

Test #3:

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

input:

5
1000
1 acbd
3 acbd acgts acvdflmn
7 acbd acgts acvdflmn admkf aehzdl aepocjmc afaeqq
16 acbd acgts acvdflmn admkf aehzdl aepocjmc afaeqq afbqeawd afjb agrfnq ahrhdp aidg aimp aiqana ajb akwm
34 acbd acgts acvdflmn admkf aehzdl aepocjmc afaeqq afbqeawd afjb agrfnq ahrhdp aidg aimp aiqana ajb akwm a...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query c 1
query c 3
query c 7
query c 16
query c 34
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
query e 1
query e 3
query e 7
query e 16
query e 34
query e...

result:

ok Ok in 3173 k

Test #4:

score: 0
Accepted
time: 7ms
memory: 3944kb

input:

5
1000
1 aaxqvzig
3 aaxqvzig abbaep actfxtivf
7 aaxqvzig abbaep actfxtivf adt adtl aer afa
16 aaxqvzig abbaep actfxtivf adt adtl aer afa agfev agluptr ahci ahdfhfr aiympo ajjcvjb ajkux akq alnoiph
34 aaxqvzig abbaep actfxtivf adt adtl aer afa agfev agluptr ahci ahdfhfr aiympo ajjcvjb ajkux akq alnoi...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query b 1
query b 3
query b 7
query b 16
query b 34
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query d 1
query d 3
query d 7
query d 16
query d 34
query e 1
query e 3
query e 7
query e 16
query e 34
query e 69
query f...

result:

ok Ok in 3173 k

Test #5:

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

input:

5
1000
1 a
3 a aalilyz ac
7 a aalilyz ac acb adcogtni adroq aepocjm
16 a aalilyz ac acb adcogtni adroq aepocjm aevi af aguwuvh agxaaac ahuwl ahxy aiafmv aisyr ajuqw
34 a aalilyz ac acb adcogtni adroq aepocjm aevi af aguwuvh agxaaac ahuwl ahxy aiafmv aisyr ajuqw ake amdjxnsmk amgcifdlj amvprza amzt a...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
query e 1
query e 3
query e 7
query e 16
query e...

result:

ok Ok in 3104 k

Test #6:

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

input:

5
1000
1 abvmqw
3 abvmqw acgt acoogjx
7 abvmqw acgt acoogjx adrvbejoo ae aeqv af
16 abvmqw acgt acoogjx adrvbejoo ae aeqv af afb afdktn aggcwzid aibg aimgcusle aiymp ajuqm al alk
34 abvmqw acgt acoogjx adrvbejoo ae aeqv af afb afdktn aggcwzid aibg aimgcusle aiymp ajuqm al alk amklrwl amncorb anaztks...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
query e 1
query e 3
query e 7
query e 16
query e...

result:

ok Ok in 3242 k

Test #7:

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

input:

5
1000
1 aavfeg
3 aavfeg abogkwk abpwnr
7 aavfeg abogkwk abpwnr abqlngdsc acbdx adgeed aerm
16 aavfeg abogkwk abpwnr abqlngdsc acbdx adgeed aerm aevi aexjyu afascs afbqeawdi afkxyfmcn afvmu agmm agwdwxsu aigw
34 aavfeg abogkwk abpwnr abqlngdsc acbdx adgeed aerm aevi aexjyu afascs afbqeawdi afkxyfmcn...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
query e 1
query e 3
query e 7
query e 16
query e...

result:

ok Ok in 3104 k

Test #8:

score: 0
Accepted
time: 7ms
memory: 3692kb

input:

5
1000
1 a
3 a aaac aac
7 a aaac aac aadrvbej aay abwun abz
16 a aaac aac aadrvbej aay abwun abz acb acn acqx actyaovq acvdf adgeedjk af ahnzdw ahxylcgn
34 a aaac aac aadrvbej aay abwun abz acb acn acqx actyaovq acvdf adgeedjk af ahnzdw ahxylcgn aidvvi aisyr aivtmpqz al an anbiypuz apjzkzn aptmp aqc...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query b 1
query b 3
query b 7
query b 16
query b 34
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
query e 1
query e 3
query e 7
query e 16
query e 34
query e...

result:

ok Ok in 3173 k

Test #9:

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

input:

5
1000
1 aaciqgnc
3 aaciqgnc aawtbc aayipsoj
7 aaciqgnc aawtbc aayipsoj abqlngds acf acqrs actad
16 aaciqgnc aawtbc aayipsoj abqlngds acf acqrs actad adrv adxm aexjy agnn agwdwxs ai aid aif aijelh
34 aaciqgnc aawtbc aayipsoj abqlngds acf acqrs actad adrv adxm aexjy agnn agwdwxs ai aid aif aijelh aj ...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query c 1
query c 3
query c 7
query c 16
query c 34
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
query e 1
query e 3
query e 7
query e 16
query e 34
query f...

result:

ok Ok in 3173 k

Test #10:

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

input:

5
1000
1 aagxaa
3 aagxaa abjc acg
7 aagxaa abjc acg aciqg acnhpzn acvdfl adtninwc
16 aagxaa abjc acg aciqg acnhpzn acvdfl adtninwc aehz aek aeqqojyp aevibe aexjyulg afbxp afl aguwuv ahcipz
34 aagxaa abjc acg aciqg acnhpzn acvdfl adtninwc aehz aek aeqqojyp aevibe aexjyulg afbxp afl aguwuv ahcipz aije...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
query e 1
query e 3
query e 7
query e 16
query e...

result:

ok Ok in 3104 k

Test #11:

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

input:

5
1000
1 aadbd
3 aadbd aadbg aaemf
7 aadbd aadbg aaemf aaepzchvxg aapihz aaqjqvgx aazfccep
16 aadbd aadbg aaemf aaepzchvxg aapihz aaqjqvgx aazfccep aaznfe abakwq abbwcmdh abdhdofrs abdjlpez abeaa abezgbabhd abgbpa abhkmvmahb
34 aadbd aadbg aaemf aaepzchvxg aapihz aaqjqvgx aazfccep aaznfe abakwq abbw...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query a 133
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query c 133
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
query d 133
...

result:

ok Ok in 2992 k

Test #12:

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

input:

5
1000
1 aabwpote
3 aabwpote aaclnnc aadjkgs
7 aabwpote aaclnnc aadjkgs aaemccd aapihztr aavaacml aazdodzr
16 aabwpote aaclnnc aadjkgs aaemccd aapihztr aavaacml aazdodzr abbaeuada abbriejjk abbzfui abcdocbn abicfcs abjcdznj abkcmdgj abrlkfgb abuesdgjja
34 aabwpote aaclnnc aadjkgs aaemccd aapihztr aa...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query a 133
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query c 133
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
query e 1
qu...

result:

ok Ok in 3042 k

Test #13:

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

input:

5
1000
1 aaaac
3 aaaac aabcfn aacafh
7 aaaac aabcfn aacafh aacklaael aacqahce aadaagbh aadneaeg
16 aaaac aabcfn aacafh aacklaael aacqahce aadaagbh aadneaeg aaeahnfag aaedi aaegsqcag aafbkbfcra aaffddb aagecekeae aaghla aagpa aajdhjlba
34 aaaac aabcfn aacafh aacklaael aacqahce aadaagbh aadneaeg aaeah...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query a 133
query a 243
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query c 133
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
...

result:

ok Ok in 2938 k

Test #14:

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

input:

5
1000
1 aabbhcc
3 aabbhcc aabfaakbdp aabpmcgoa
7 aabbhcc aabfaakbdp aabpmcgoa aabzaecvji aadcaoscc aadcbqgafi aaeizjcec
16 aabbhcc aabfaakbdp aabpmcgoa aabzaecvji aadcaoscc aadcbqgafi aaeizjcec aafaedcb aafbefhcab aafbygbcc aagobdhafb aajhdbdlm aakbaezd aakcbfob aalddlb aapbkagbc
34 aabbhcc aabfaak...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query a 133
query a 243
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query c 133
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
...

result:

ok Ok in 3062 k

Test #15:

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

input:

5
1000
1 aaaaaibb
3 aaaaaibb aaabaa aaabceaid
7 aaaaaibb aaabaa aaabceaid aaabf aaagbba aaagpabe aaahcab
16 aaaaaibb aaabaa aaabceaid aaabf aaagbba aaagpabe aaahcab aaamdca aabhbhbf aabhdl aabicbiaa aabjcngb aacafh aacdcaca aacia aaclg
34 aaaaaibb aaabaa aaabceaid aaabf aaagbba aaagpabe aaahcab aaam...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query a 133
query a 243
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query b 243
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query c 133
query d 1
query d 3
query d 7
query d 16
query d 34...

result:

ok Ok in 2854 k

Test #16:

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

input:

5
1000
1 aaabfdi
3 aaabfdi aaabied aaacbfg
7 aaabfdi aaabied aaacbfg aaaeebaf aaafbeabii aaagbbabh aaaqpbb
16 aaabfdi aaabied aaacbfg aaaeebaf aaafbeabii aaagbbabh aaaqpbb aaaudai aabaabge aabbbdc aabcehac aabeabfacb aabedfk aacaeaaeac aaccfdc aacgdicaa
34 aaabfdi aaabied aaacbfg aaaeebaf aaafbeabii...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query a 133
query a 243
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query b 243
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query c 133
query d 1
query d 3
query d 7
query d 16
query d 34...

result:

ok Ok in 2895 k

Test #17:

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

input:

5
1000
1 aaaab
3 aaaab aaaad aaaaeddca
7 aaaab aaaad aaaaeddca aaabceaed aaabf aaacbaa aaaedfecd
16 aaaab aaaad aaaaeddca aaabceaed aaabf aaacbaa aaaedfecd aaafd aaafdegda aaamaab aaanae aabaacfca aabajbdbda aabak aabbgddaaa aabca
34 aaaab aaaad aaaaeddca aaabceaed aaabf aaacbaa aaaedfecd aaafd aaaf...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query a 133
query a 243
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query b 243
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query c 133
query c 243
query d 1
query d 3
query d 7
query d 1...

result:

ok Ok in 3232 k

Test #18:

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

input:

5
1000
1 aaaadbaab
3 aaaadbaab aaaagbae aaabhab
7 aaaadbaab aaaagbae aaabhab aaacakhd aaacbcbaqe aaadacda aaadfagae
16 aaaadbaab aaaagbae aaabhab aaacakhd aaacbcbaqe aaadacda aaadfagae aaaeaaaebr aaaeaekea aaaebbdfe aaajbbb aabaabgd aabaeefbfa aabakfbeb aabbaaai aabbbbcfbj
34 aaaadbaab aaaagbae aaab...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query a 133
query a 243
query a 418
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query b 243
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query c 133
query c 243
query d 1
query d 3
query d...

result:

ok Ok in 3097 k

Test #19:

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

input:

5
1000
1 aaaaaedd
3 aaaaaedd aaaab aaaabb
7 aaaaaedd aaaab aaaabb aaaabc aaaadda aaaaeabb aaabaa
16 aaaaaedd aaaab aaaabb aaaabc aaaadda aaaaeabb aaabaa aaabbcaabh aaabbncfba aaabd aaabeda aaabi aaacaad aaackaaee aaadbaab aaadbc
34 aaaaaedd aaaab aaaabb aaaabc aaaadda aaaaeabb aaabaa aaabbcaabh aaab...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query a 133
query a 243
query a 418
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query b 243
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query c 133
query d 1
query d 3
query d 7
query d 1...

result:

ok Ok in 2881 k

Test #20:

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

input:

5
1000
1 aaaaaaakf
3 aaaaaaakf aaaaaadda aaaaacf
7 aaaaaaakf aaaaaadda aaaaacf aaaacaabc aaaadbaa aaaafaia aaaafeaeeb
16 aaaaaaakf aaaaaadda aaaaacf aaaacaabc aaaadbaa aaaafaia aaaafeaeeb aaabbcaa aaabceaaa aaabdbb aaabeda aaabiaagh aaacbcbaqe aaacbdf aaaceaa aaadacaa
34 aaaaaaakf aaaaaadda aaaaacf ...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query a 133
query a 243
query a 418
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query b 243
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query c 133
query c 243
query d 1
query d 3
query d...

result:

ok Ok in 3008 k

Test #21:

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

input:

1
1000
0
1 bagaoguesy
3 bagaoguesy bajdjjxkus bamxlzqrbg
7 bagaoguesy bajdjjxkus bamxlzqrbg baqstjbgkd baxomczwvf bbcczeqbln bbfivcdxcq
16 bagaoguesy bajdjjxkus bamxlzqrbg baqstjbgkd baxomczwvf bbcczeqbln bbfivcdxcq bbkdokgwfw bbmbmkokgs bbvoexrygb bcaymppyki bcmiphiusu bcmxmroxcd bdbyzxwgsz bdldfhx...

output:

query a 1
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query i 3
query i 7
query i 16
query i 34
query i 69
query i 133
query j 1
query k 1
query l 1
query m 1
query m 3
query m 7
query m 16
query m 3...

result:

ok Ok in 3061 k

Test #22:

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

input:

1
1000
0
1 babuzeiopu
3 babuzeiopu baekaudviq baerbtrcoo
7 babuzeiopu baekaudviq baerbtrcoo bajklhxyid bajxsdfnaz bakbkywipe bakwsjgopl
16 babuzeiopu baekaudviq baerbtrcoo bajklhxyid bajxsdfnaz bakbkywipe bakwsjgopl bamuoeesxn bamvowdurh bapdftjwal baspeslstz batmiwceso bbcbfvdhfu bbdzcicloo bbepavi...

output:

query a 1
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query b 243
query b 418
query c 1
query d 1
query d 3
query d 7
query d 16
query d 34
query d 69
query d 133
query d 243
query d 418
query e 1
query f 1
query f 3
query f 7
query f 16
query f 34
query g 1
query h 1
...

result:

ok Ok in 3272 k

Test #23:

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

input:

1
1000
1 aahisutiku
3 aahisutiku aakxjvgzfg aamvtdufhl
7 aahisutiku aakxjvgzfg aamvtdufhl aaprijqexs abeysgmdvz abkhygxbld abyfnocctt
16 aahisutiku aakxjvgzfg aamvtdufhl aaprijqexs abeysgmdvz abkhygxbld abyfnocctt acboavgdvp acrpgutmfc adaavgwzbu adkpbomane adpyjhbwrv aekrlovqls aermhtyecx aewbmuirz...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query d 1
query e 1
query e 3
query f 1
query g 1
query g 3
query g 7
query g 16
query g 34
query g 69
query h ...

result:

ok Ok in 2544 k

Test #24:

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

input:

1
1000
1 adwrfxvqth
3 adwrfxvqth akykuvdgif aosgchfnkc
7 adwrfxvqth akykuvdgif aosgchfnkc apmnedzewx arjntqhinl arkgjayddx avjczjvyww
8 adwrfxvqth akykuvdgif aosgchfnkc apmnedzewx arjntqhinl arkgjayddx avjczjvyww awvoeoenja
1 bariprplmb
3 bariprplmb bbdehlqkie bbdnupnpqe
7 bariprplmb bbdehlqkie bbdn...

output:

query a 1
query a 3
query a 7
query a 16
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query c 1
query c 3
query c 7
query c 16
query c 34
query d 1
query e 1
query e 3
query e 7
query e 16
query e 34
query e 69
query e 133
query e 243
query e 418
query f 1
query f 3
que...

result:

ok Ok in 3104 k

Test #25:

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

input:

1
1000
0
0
1 cbepuznjbc
3 cbepuznjbc cbilnwqszh cbnhflckuo
7 cbepuznjbc cbilnwqszh cbnhflckuo cbrqmcwarn cbrwvaeoqj cbuvzuspvx cbvbibnvnn
16 cbepuznjbc cbilnwqszh cbnhflckuo cbrqmcwarn cbrwvaeoqj cbuvzuspvx cbvbibnvnn cdjdgylqpc cdplbcgtyo cduoxeltku cdzalgjsmw cejvnqvmhl celaublikb cerewvvqgh cessn...

output:

query a 1
query b 1
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query j 1
query j 3
query j 7
query j 16
query j 34
query k 1
query l 1
query l 3
query l 7
query l 16
query l 34
query l 69
query l 133
query l 243
query l ...

result:

ok Ok in 3027 k

Test #26:

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

input:

1
1000
0
1 babktgvctu
3 babktgvctu bacckliudy badycnijil
7 babktgvctu bacckliudy badycnijil baetozsvwo bafkjjimwe bahqwfghge bakdzdncvx
16 babktgvctu bacckliudy badycnijil baetozsvwo bafkjjimwe bahqwfghge bakdzdncvx bakxnjuted balwwpmrvk bamtkbtrfg baomixiagc baoqpmlyvb bapyoakqbf bapyticavb barehbl...

output:

query a 1
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query b 243
query b 418
query b 665
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
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 ...

result:

ok Ok in 3237 k

Test #27:

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

input:

1
1000
1 anpmcjtvhc
1 anpmcjtvhc
1 babqiytdti
3 babqiytdti backovxsdu bacnnmlgfv
7 babqiytdti backovxsdu bacnnmlgfv badvigqcqh bafemlfuaz bafvsugtiw bagguxpimu
16 babqiytdti backovxsdu bacnnmlgfv badvigqcqh bafemlfuaz bafvsugtiw bagguxpimu bagwdcjohm bahoawcolg balfvfqttv balnimeoft banmitywys banvd...

output:

query a 1
query a 3
query b 1
query b 3
query b 7
query b 16
query b 34
query b 69
query b 133
query b 243
query b 418
query c 1
query c 3
query d 1
query e 1
query e 3
query e 7
query e 16
query e 34
query e 69
query e 133
query e 243
query e 418
query e 665
query f 1
query g 1
query h 1
query i 1
...

result:

ok Ok in 2820 k

Test #28:

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

input:

1
1000
0
0
1 cadaytkjkd
3 cadaytkjkd cafzgsqgfu caqlhlglip
7 cadaytkjkd cafzgsqgfu caqlhlglip casxpxqqoa catxklbkrn caxsnclszq cayihgbkpv
16 cadaytkjkd cafzgsqgfu caqlhlglip casxpxqqoa catxklbkrn caxsnclszq cayihgbkpv cbbdesifkj cbggreijir cbghfxiqvo cblngggqxz cbnnrjgzpl cbtsxigphe cbycfnbeum ccfxo...

output:

query a 1
query b 1
query c 1
query c 3
query c 7
query c 16
query c 34
query c 69
query c 133
query c 243
query d 1
query e 1
query e 3
query e 7
query e 16
query e 34
query e 69
query e 133
query e 243
query f 1
query g 1
query g 3
query h 1
query i 1
query j 1
query k 1
query k 3
query k 7
query ...

result:

ok Ok in 3028 k

Test #29:

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

input:

1
1000
0
1 bbebxtglxm
3 bbebxtglxm bdzpwcbwvo bfurjatycr
7 bbebxtglxm bdzpwcbwvo bfurjatycr bmfsbdoxww bpfvjcmlct bpmixrqzfb bylpzqlgxq
7 bbebxtglxm bdzpwcbwvo bfurjatycr bmfsbdoxww bpfvjcmlct bpmixrqzfb bylpzqlgxq
0
0
0
0
0
0
1 iabmdmtywa
3 iabmdmtywa iaemjvkjdy iakpsrcnhb
7 iabmdmtywa iaemjvkjdy i...

output:

query a 1
query b 1
query b 3
query b 7
query b 16
query c 1
query d 1
query e 1
query f 1
query g 1
query h 1
query i 1
query i 3
query i 7
query i 16
query i 34
query i 69
query i 133
query i 243
query j 1
query k 1
query k 3
query k 7
query l 1
query l 3
query l 7
query l 16
query l 34
query l 69...

result:

ok Ok in 3270 k

Test #30:

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

input:

1
1000
0
0
0
1 dkthhcxrcq
1 dkthhcxrcq
1 eakgfiehic
3 eakgfiehic eaqjfngdky ebgxwpmnxx
7 eakgfiehic eaqjfngdky ebgxwpmnxx ebidmjgczs ebubwrmjdc ecdjuyzyjs ecmzzanhuc
16 eakgfiehic eaqjfngdky ebgxwpmnxx ebidmjgczs ebubwrmjdc ecdjuyzyjs ecmzzanhuc ecsnhvefww ectepkuesj ecxteexpsq edamjdhdsc edclhhotsr...

output:

query a 1
query b 1
query c 1
query d 1
query d 3
query e 1
query e 3
query e 7
query e 16
query e 34
query e 69
query e 133
query f 1
query f 3
query g 1
query h 1
query h 3
query i 1
query i 3
query j 1
query j 3
query j 7
query j 16
query j 34
query k 1
query k 3
query k 7
query k 16
query k 34
q...

result:

ok Ok in 3081 k

Test #31:

score: -100
Wrong Answer
time: 17ms
memory: 3940kb

input:

5
1000
1 aaaiqwexnq
3 aaaiqwexnq aadjcquqdq aafaldvvzr
7 aaaiqwexnq aadjcquqdq aafaldvvzr aaflmsydwu aafwzaqmhr aafypzoakd aahtirtmve
16 aaaiqwexnq aadjcquqdq aafaldvvzr aaflmsydwu aafwzaqmhr aafypzoakd aahtirtmve aaitvirspt aajkhyjujl aajwmyiykc aamnvriles aamotubelz aanjhaxtjv aanpnufnlu aanxeqwcu...

output:

query a 1
query a 3
query a 7
query a 16
query a 34
query a 69
query a 133
query a 243
query a 418
query a 665
query a 939
query a 1041

result:

wrong answer ct k = 1041