diff --git "a/pseudo_to_code_0.5k.jsonl" "b/pseudo_to_code_0.5k.jsonl" new file mode 100644--- /dev/null +++ "b/pseudo_to_code_0.5k.jsonl" @@ -0,0 +1,199 @@ +{"instance_id":"pseudo_to_code_0.5k_0","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integer k and an array x with size 3\n read x[0], x[1] and x[2] from the input\n sort x\n assign x[2] - x[0] to k\n print k\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int x[3], k;\n cin >> x[0] >> x[1] >> x[2];\n sort(x, x + 3);\n k = x[2] - x[0];\n cout << k << endl;\n return 0;\n}","item":{"problem_id":"723A","pseudocode":"define the main function\n create integer k and an array x with size 3\n read x[0], x[1] and x[2] from the input\n sort x\n assign x[2] - x[0] to k\n print k\n return to indicate successful execution\nend of the block","testcases":[[["7 1 4"],["6"]],[["30 20 10"],["20"]],[["1 4 100"],["99"]],[["100 1 91"],["99"]],[["1 45 100"],["99"]],[["1 2 3"],["2"]],[["71 85 88"],["17"]],[["30 38 99"],["69"]],[["23 82 95"],["72"]],[["22 41 47"],["25"]],[["9 94 77"],["85"]],[["1 53 51"],["52"]],[["25 97 93"],["72"]],[["42 53 51"],["11"]],[["81 96 94"],["15"]],[["21 5 93"],["88"]],[["50 13 75"],["62"]],[["41 28 98"],["70"]],[["69 46 82"],["36"]],[["87 28 89"],["61"]],[["44 45 40"],["5"]],[["86 97 68"],["29"]],[["43 92 30"],["62"]],[["16 70 1"],["69"]],[["40 46 19"],["27"]],[["71 38 56"],["33"]],[["82 21 80"],["61"]],[["75 8 35"],["67"]],[["75 24 28"],["51"]],[["78 23 56"],["55"]],[["85 31 10"],["75"]],[["76 50 9"],["67"]],[["95 37 34"],["61"]],[["84 61 35"],["49"]],[["87 85 37"],["50"]],[["1 3 2"],["2"]],[["4 2 6"],["4"]],[["6 9 3"],["6"]],[["12 4 8"],["8"]],[["15 10 5"],["10"]],[["1 50 17"],["49"]],[["10 5 15"],["10"]],[["8 1 9"],["8"]],[["3 5 4"],["2"]],[["2 1 3"],["2"]],[["1 8 2"],["7"]],[["1 100 2"],["99"]],[["1 4 6"],["5"]]]}} +{"instance_id":"pseudo_to_code_0.5k_1","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create string s\n read s\n make char cur = 'a'\n make int mn\n let integer ans = 0\n for i = 0 to s.length() exclusive\n set mn to min(abs(s[i] - cur), abs(26 - abs((s[i] - cur))))\n set ans to ans + mn\n set cur to s[i]\n end of the block\n display ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string s;\n cin >> s;\n char cur = 'a';\n int mn;\n int ans = 0;\n for (int i = 0; i < s.length(); i++) {\n mn = min(abs(s[i] - cur), abs(26 - abs((s[i] - cur))));\n ans += mn;\n cur = s[i];\n }\n cout << ans << '\\n';\n return 0;\n}","item":{"problem_id":"731A","pseudocode":"define the main function\n create string s\n read s\n make char cur = 'a'\n make int mn\n let integer ans = 0\n for i = 0 to s.length() exclusive\n set mn to min(abs(s[i] - cur), abs(26 - abs((s[i] - cur))))\n set ans to ans + mn\n set cur to s[i]\n end of the block\n display ans\n return to indicate successful execution\nend of the block","testcases":[[["zeus"],["18"]],[["map"],["35"]],[["ares"],["34"]],[["l"],["11"]],[["abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv"],["99"]],[["gngvi"],["44"]],[["aaaaa"],["0"]],[["a"],["0"]],[["z"],["1"]],[["vyadeehhikklnoqrs"],["28"]],[["jjiihhhhgggfedcccbazyxx"],["21"]],[["fyyptqqxuciqvwdewyppjdzur"],["117"]],[["fqcnzmzmbobmancqcoalzmanaobpdse"],["368"]],[["zzzzzaaaaaaazzzzzzaaaaaaazzzzzzaaaazzzza"],["8"]],[["aucnwhfixuruefkypvrvnvznwtjgwlghoqtisbkhuwxmgzuljvqhmnwzisnsgjhivnjmbknptxatdkelhzkhsuxzrmlcpeoyukiy"],["644"]],[["sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"],["8"]],[["nypjygrdtpzpigzyrisqeqfriwgwlengnezppgttgtndbrryjdl"],["421"]],[["pnllnnmmmmoqqqqqrrtssssuuvtsrpopqoonllmonnnpppopnonoopooqpnopppqppqstuuuwwwwvxzxzzaa"],["84"]],[["btaoahqgxnfsdmzsjxgvdwjukcvereqeskrdufqfqgzqfsftdqcthtkcnaipftcnco"],["666"]],[["eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrwwwwwwwwww"],["22"]],[["uyknzcrwjyzmscqucclvacmorepdgmnyhmakmmnygqwglrxkxhkpansbmruwxdeoprxzmpsvwackopujxbbkpwyeggsvjykpxh"],["643"]],[["gzwpooohffcxwtpjgfzwtooiccxsrrokezutoojdzwsrmmhecaxwrojcbyrqlfdwwrliiib"],["245"]],[["dbvnkktasjdwqsrzfwwtmjgbcxggdxsoeilecihduypktkkbwfbruxzzhlttrssicgdwqruddwrlbtxgmhdbatzvdxbbro"],["468"]],[["mdtvowlktxzzbuaeiuebfeorgbdczauxsovbucactkvyvemsknsjfhifqgycqredzchipmkvzbxdjkcbyukomjlzvxzoswumned"],["523"]],[["kkkkkkkaaaaxxaaaaaaaxxxxxxxxaaaaaaxaaaaaaaaaakkkkkkkkkaaaaaaannnnnxxxxkkkkkkkkaannnnnnna"],["130"]],[["dffiknqqrsvwzcdgjkmpqtuwxadfhkkkmpqrtwxyadfggjmpppsuuwyyzcdgghhknnpsvvvwwwyabccffiloqruwwyyzabeeehh"],["163"]],[["qpppmmkjihgecbyvvsppnnnkjiffeebaaywutrrqpmkjhgddbzzzywtssssqnmmljheddbbaxvusrqonmlifedbbzyywwtqnkheb"],["155"]],[["wvvwwwvvwxxxyyyxxwwvwwvuttttttuvvwxxwxxyxxwwwwwvvuttssrssstsssssrqpqqppqrssrsrrssrssssrrsrqqrrqpppqp"],["57"]],[["dqcpcobpcobnznamznamzlykxkxlxlylzmaobnaobpbnanbpcoaobnboaoboanzlymzmykylymylzlylymanboanaocqdqesfrfs"],["1236"]],[["nnnnnnnnnnnnnnnnnnnnaaaaaaaaaaaaaaaaaaaakkkkkkkkkkkkkkkkkkkkkkaaaaaaaaaaaaaaaaaaaaxxxxxxxxxxxxxxxxxx"],["49"]],[["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"],["0"]],[["cgilqsuwzaffilptwwbgmnttyyejkorxzflqvzbddhmnrvxchijpuwaeiimosxyycejlpquuwbfkpvbgijkqvxybdjjjptxcfkqt"],["331"]],[["ufsepwgtzgtgjssxaitgpailuvgqweoppszjwhoxdhhhpwwdorwfrdjwcdekxiktwziqwbkvbknrtvajpyeqbjvhiikxxaejjpte"],["692"]],[["uhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuh"],["1293"]],[["vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvgggggggggggggggggggggggggggggggggggggggggggggggggg"],["16"]],[["lyidmjyzbszgiwkxhhpnnthfwcvvstueionspfrvqgkvngmwyhezlosrpdnbvtcjjxxsykixwnepbumaacdzadlqhnjlcejovple"],["616"]],[["etzqqbaveffalkdguunfmyyrzkccnxmlluxeasqmopxzfvlkbhipqdwjgrttoemruohgwukfisdhznqyvhswbbypoxgtxyappcrl"],["605"]],[["lizussgedcbdjhrbeskhgatyozvwwekanlggcstijrniivupmcoofbaxfqrxddyzzptwxcftlhajsmmkkriarrqtkoauhcqefyud"],["549"]],[["dvjuvgfdogpknmbowlsfjzcimnygbtjiucyeeroqwhmzwpjqxlbjkqawrdtmvxbiqufllfuqibxvmtdrwaqkjblxqjpwzmhwqore"],["688"]],[["eeycuijtbgynmiczjfslwobmnkpgodfgvujvduyfeqchuaoktqrrairkkmmsjahltfcxwtpzzyddxrqfxabfoocmpuviinrjitsc"],["604"]],[["cgglnakewwvzoytaghksebrhjdbcdegssuzilrcppayxtgxopybbwshvyqnzhdsifkuwghourmeottrgjwdqpihbklvfzxpomqsa"],["572"]],[["aexullmxncckzryymfnuugdklaffevabqqztelpvojecljnhqldazdcaamubpenwxikysxxjjctvbndprsolzehywmgnvkgqvrfp"],["609"]],[["psnoieutsvvcwfhtnnphhxkwigzsbzyjmdiyl"],["223"]],[["aa"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_2","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare tostr with integer n as argument, returning string\n declare stringstream rr\n read n with rr\n return string from rr\nend of the block\ndeclare check_lucky with long long n as argument, returning integer\n while n is greater than 0\n if n % 10 is 8, return 1 from function\n let n be n \/ 10\n end of the block\n return to indicate successful execution\nend of the block\ndefine the main function\n declare long long a\n read a\n declare integer res = 0\n while result of run check_lucky( absolute value of a ) is false or res is 0\n increment res by 1\n increment a by 1\n end of the block\n print res and newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"string tostr(int n) {\n stringstream rr;\n rr << n;\n return rr.str();\n}\nint check_lucky(long long n) {\n while (n > 0) {\n if (n % 10 == 8) { return 1; }\n n \/= 10;\n }\n return 0;\n}\nint main() {\n long long a;\n cin >> a;\n int res = 0;\n while (!check_lucky(abs(a)) || (res == 0)) {\n res += 1;\n a += 1;\n }\n cout << res << endl;\n return 0;\n}","item":{"problem_id":"488A","pseudocode":"declare tostr with integer n as argument, returning string\n declare stringstream rr\n read n with rr\n return string from rr\nend of the block\ndeclare check_lucky with long long n as argument, returning integer\n while n is greater than 0\n if n % 10 is 8, return 1 from function\n let n be n \/ 10\n end of the block\n return to indicate successful execution\nend of the block\ndefine the main function\n declare long long a\n read a\n declare integer res = 0\n while result of run check_lucky( absolute value of a ) is false or res is 0\n increment res by 1\n increment a by 1\n end of the block\n print res and newline\n return to indicate successful execution\nend of the block","testcases":[[["179"],["1"]],[["-1"],["9"]],[["18"],["10"]],[["-410058385"],["1"]],[["-586825624"],["1"]],[["852318890"],["1"]],[["919067153"],["5"]],[["690422411"],["7"]],[["-408490162"],["1"]],[["-8"],["16"]],[["-6"],["14"]],[["-4"],["12"]],[["-2"],["10"]],[["0"],["8"]],[["2"],["6"]],[["4"],["4"]],[["6"],["2"]],[["8"],["10"]],[["1000000000"],["8"]],[["-1000000000"],["2"]],[["88888"],["1"]],[["89"],["9"]],[["-80000000"],["2"]],[["-8888"],["1"]],[["-17"],["9"]],[["78"],["2"]],[["-19"],["1"]],[["-999999998"],["9"]],[["-999999997"],["8"]],[["999999997"],["1"]],[["811111111"],["1"]],[["-8"],["16"]],[["-5"],["13"]],[["-7"],["15"]],[["1000000000"],["8"]]]}} +{"instance_id":"pseudo_to_code_0.5k_3","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n x, y, z = long long\n read x, y\n let z = (y - 1) \/ x\n add one to z\n print z\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long x, y, z;\n cin >> x >> y;\n z = (y - 1) \/ x;\n z++;\n cout << z << endl;\n return 0;\n}","item":{"problem_id":"1061A","pseudocode":"define the main function\n x, y, z = long long\n read x, y\n let z = (y - 1) \/ x\n add one to z\n print z\n return to indicate successful execution\nend of the block","testcases":[[["5 11"],["3"]],[["6 16"],["3"]],[["14 28"],["2"]],[["5 29"],["6"]],[["10 24"],["3"]],[["1 30"],["30"]],[["14969 66991573"],["4476"]],[["1 1000000000"],["1000000000"]],[["100000 1"],["1"]],[["10 46"],["5"]],[["11 35"],["4"]],[["12 45"],["4"]],[["15 34"],["3"]],[["31859 629091638"],["19747"]],[["15666 689919612"],["44040"]],[["90681 254480989"],["2807"]],[["69018 523197828"],["7581"]],[["1352 434805201"],["321602"]],[["73439 384841883"],["5241"]],[["42482 352232377"],["8292"]],[["57862 374476819"],["6472"]],[["41711 440229650"],["10555"]],[["46602 894472145"],["19194"]],[["47832 942980453"],["19715"]],[["22951 747845288"],["32585"]],[["76998 722886555"],["9389"]],[["68666 512525633"],["7465"]],[["66269 356663481"],["5383"]],[["56624 922065652"],["16285"]],[["31618 26008350"],["823"]],[["90952 904040054"],["9940"]],[["49630 947487392"],["19092"]],[["45084 431878651"],["9580"]],[["7156 806580442"],["112714"]],[["2 193379347"],["96689674"]],[["6 823813339"],["137302224"]],[["5 939845324"],["187969065"]],[["7 236413222"],["33773318"]],[["10 695784696"],["69578470"]],[["3 877026418"],["292342140"]],[["8 550991517"],["68873940"]],[["6 899779610"],["149963269"]],[["12 394018478"],["32834874"]],[["66 63576176"],["963276"]],[["66 982670621"],["14888949"]],[["8 750191967"],["93773996"]],[["10 349992600"],["34999260"]],[["65 281828001"],["4335816"]],[["53 468285594"],["8835578"]],[["83 361125900"],["4350915"]],[["15 191203328"],["12746889"]],[["100000 1000000000"],["10000"]],[["2 999999999"],["500000000"]],[["2 1000000000"],["500000000"]],[["4821 917142246"],["190240"]]]}} +{"instance_id":"pseudo_to_code_0.5k_4","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integer variables x1, x2, y1 and y2\n declare integers diff1 and diff2\n read x1 and y1\n read x2 and y2\n set value of diff1 to absolute value of x2 - x1\n set diff2 to absolute value of y2 - y1\n if diff1 is greater than diff2\n print diff1\n else if diff2 is greater than diff1\n print diff2\n else if diff1 = diff2\n print diff1\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int x1, x2, y1, y2;\n int diff1, diff2;\n cin >> x1 >> y1;\n cin >> x2 >> y2;\n diff1 = abs(x2 - x1);\n diff2 = abs(y2 - y1);\n if (diff1 > diff2) {\n cout << diff1 << endl;\n } else if (diff2 > diff1) {\n cout << diff2 << endl;\n } else if (diff1 == diff2) {\n cout << diff1 << endl;\n }\n}","item":{"problem_id":"620A","pseudocode":"define the main function\n declare integer variables x1, x2, y1 and y2\n declare integers diff1 and diff2\n read x1 and y1\n read x2 and y2\n set value of diff1 to absolute value of x2 - x1\n set diff2 to absolute value of y2 - y1\n if diff1 is greater than diff2\n print diff1\n else if diff2 is greater than diff1\n print diff2\n else if diff1 = diff2\n print diff1\n end of the block\nend of the block","testcases":[[["0 0","4 5"],["5"]],[["3 4","6 1"],["3"]],[["0 0","4 6"],["6"]],[["1 1","-3 -5"],["6"]],[["-1 -1","-10 100"],["101"]],[["1 -1","100 -100"],["99"]],[["-1000000000 -1000000000","1000000000 1000000000"],["2000000000"]],[["-1000000000 -1000000000","0 999999999"],["1999999999"]],[["0 0","2 1"],["2"]],[["10 0","100 0"],["90"]],[["1 5","6 4"],["5"]],[["0 0","5 4"],["5"]],[["10 1","20 1"],["10"]],[["1 1","-3 4"],["4"]],[["-863407280 504312726","786535210 -661703810"],["1649942490"]],[["-588306085 -741137832","341385643 152943311"],["929691728"]],[["0 0","4 0"],["4"]],[["93097194 -48405232","-716984003 -428596062"],["810081197"]],[["9 1","1 1"],["8"]],[["4 6","0 4"],["4"]],[["2 4","5 2"],["3"]],[["-100000000 -100000000","100000000 100000123"],["200000123"]],[["5 6","5 7"],["1"]],[["12 16","12 1"],["15"]],[["0 0","5 1"],["5"]],[["0 1","1 1"],["1"]],[["-44602634 913365223","-572368780 933284951"],["527766146"]],[["-2 0","2 -2"],["4"]],[["0 0","3 1"],["3"]],[["-458 2","1255 4548"],["4546"]],[["-5 -4","-3 -3"],["2"]],[["4 5","7 3"],["3"]],[["-1000000000 -999999999","1000000000 999999998"],["2000000000"]],[["-1000000000 -1000000000","1000000000 -1000000000"],["2000000000"]],[["-464122675 -898521847","656107323 -625340409"],["1120229998"]],[["-463154699 -654742385","-699179052 -789004997"],["236024353"]],[["982747270 -593488945","342286841 -593604186"],["640460429"]],[["-80625246 708958515","468950878 574646184"],["549576124"]],[["0 0","1 0"],["1"]],[["109810 1","2 3"],["109808"]],[["-9 0","9 9"],["18"]],[["9 9","9 9"],["0"]],[["1 1","4 3"],["3"]],[["1 2","45 1"],["44"]],[["207558188 -313753260","-211535387 -721675423"],["419093575"]],[["-11 0","0 0"],["11"]],[["-1000000000 1000000000","1000000000 -1000000000"],["2000000000"]],[["0 0","1 1"],["1"]],[["0 0","0 1"],["1"]],[["0 0","-1 1"],["1"]],[["0 0","-1 0"],["1"]],[["0 0","-1 -1"],["1"]],[["0 0","0 -1"],["1"]],[["0 0","1 -1"],["1"]],[["10 90","90 10"],["80"]],[["851016864 573579544","-761410925 -380746263"],["1612427789"]],[["1 9","9 9"],["8"]],[["1000 1000","1000 1000"],["0"]],[["1 9","9 1"],["8"]],[["1 90","90 90"],["89"]],[["100 100","1000 1000"],["900"]],[["-1 0","0 0"],["1"]],[["-750595959 -2984043","649569876 -749608783"],["1400165835"]],[["958048496 712083589","423286949 810566863"],["534761547"]],[["146316710 53945094","-523054748 147499505"],["669371458"]],[["50383856 -596516251","-802950224 -557916272"],["853334080"]],[["-637204864 -280290367","-119020929 153679771"],["518183935"]],[["-100 -100","-60 -91"],["40"]],[["337537326 74909428","-765558776 167951547"],["1103096102"]],[["0 81","18 90"],["18"]],[["283722202 -902633305","-831696497 -160868946"],["1115418699"]],[["1000 1000","-1000 1000"],["2000"]],[["5 6","4 8"],["2"]],[["40572000 597493595","-935051731 368493185"],["975623731"]],[["-5 5","5 5"],["10"]]]}} +{"instance_id":"pseudo_to_code_0.5k_5","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare new int n and int array a with 1010 elements\n read n from the input\n read n sequential elements of a from the input\n sort a\n if a[0] - 1 <= 0\n print -1\n else\n print 1\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, a[1010];\n cin >> n;\n for (int i = 0; i < n; i++) { cin >> a[i]; }\n sort(a, a + n);\n if (a[0] - 1 <= 0) {\n cout << -1 << endl;\n } else {\n cout << 1 << endl;\n }\n return 0;\n}","item":{"problem_id":"560A","pseudocode":"define the main function\n declare new int n and int array a with 1010 elements\n read n from the input\n read n sequential elements of a from the input\n sort a\n if a[0] - 1 <= 0\n print -1\n else\n print 1\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["5","1 2 3 4 5"],["-1"]],[["1","2"],["1"]],[["10","371054 506438 397130 1 766759 208409 769264 549213 641270 771837"],["-1"]],[["10","635370 154890 909382 220996 276501 716105 538714 140162 171960 271264"],["1"]],[["50","110876 835020 859879 999908 712969 788264 287153 921820 330355 499311 209594 484829 296329 940051 174081 931503 1 780512 390075 97866 124255 950067 697612 244256 782385 789882 37608 82153 399889 598867 416717 377988 535636 511221 792568 683271 131077 290194 496712 330720 587436 563481 645817 942562 654093 980561 382937 48293 582608 116156"],["-1"]],[["50","474421 421097 217233 156339 27075 733996 281778 863492 184707 956857 288561 70997 393786 337382 663642 131184 637 273801 799870 295017 392338 842567 161819 297705 102013 930684 375703 838048 154915 138503 629056 256591 893619 19263 787927 684541 320265 841090 421423 490879 394582 493952 619247 633202 612928 50907 276653 407819 489945 153173"],["1"]],[["1","1"],["-1"]],[["1","1000000"],["1"]],[["2","3 2"],["1"]],[["2","2 3"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_6","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate long long integers a, b, and c and long long array of size 100001\ndefine the main function\n read a and b\n for i = 0 to a exclusive, read x[i] and set c to c + (x[i] + b - 1) \/ b\n print (c + 1) \/ 2\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"long long a, b, c, x[100001];\nint main() {\n cin >> a >> b;\n for (int i = 0; i < a; i++) cin >> x[i], c += (x[i] + b - 1) \/ b;\n cout << (c + 1) \/ 2 << endl;\n return 0;\n}","item":{"problem_id":"789A","pseudocode":"create long long integers a, b, and c and long long array of size 100001\ndefine the main function\n read a and b\n for i = 0 to a exclusive, read x[i] and set c to c + (x[i] + b - 1) \/ b\n print (c + 1) \/ 2\n return to indicate successful execution\nend of the block","testcases":[[["3 2","2 3 4"],["3"]],[["5 4","3 1 8 9 7"],["5"]],[["1 22","1"],["1"]],[["3 57","78 165 54"],["3"]],[["5 72","74 10 146 189 184"],["6"]],[["9 13","132 87 200 62 168 51 185 192 118"],["48"]],[["1 1","10000"],["5000"]],[["10 1","1 1 1 1 1 1 1 1 1 1"],["5"]],[["2 2","2 2"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_7","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n = int\n read n\n count = 0 = int\n k = int array of length n\n read the first n elements of k\n mini, maxi = int\n for i = 0 to n exclusive\n if i = 0\n set mini to k[i]\n set maxi to k[i]\n end of the block\n if k[i] < mini\n increment count\n set mini to k[i]\n end of the block\n if k[i] > maxi\n increment count\n set maxi to k[i]\n end of the block\n end of the block\n print count\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n int count = 0;\n int k[n];\n for (int i = 0; i < n; i++) { cin >> k[i]; }\n int mini, maxi;\n for (int i = 0; i < n; i++) {\n if (i == 0) {\n mini = k[i];\n maxi = k[i];\n }\n if (k[i] < mini) {\n count++;\n mini = k[i];\n }\n if (k[i] > maxi) {\n count++;\n maxi = k[i];\n }\n }\n cout << count << endl;\n return 0;\n}","item":{"problem_id":"155A","pseudocode":"define the main function\n n = int\n read n\n count = 0 = int\n k = int array of length n\n read the first n elements of k\n mini, maxi = int\n for i = 0 to n exclusive\n if i = 0\n set mini to k[i]\n set maxi to k[i]\n end of the block\n if k[i] < mini\n increment count\n set mini to k[i]\n end of the block\n if k[i] > maxi\n increment count\n set maxi to k[i]\n end of the block\n end of the block\n print count\n return to indicate successful execution\nend of the block","testcases":[[["5","100 50 200 150 200"],["2"]],[["10","4664 6496 5814 7010 5762 5736 6944 4850 3698 7242"],["4"]],[["1","6"],["0"]],[["2","2 1"],["1"]],[["5","100 36 53 7 81"],["2"]],[["5","7 36 53 81 100"],["4"]],[["5","100 81 53 36 7"],["4"]],[["10","8 6 3 4 9 10 7 7 1 3"],["5"]],[["10","1627 1675 1488 1390 1812 1137 1746 1324 1952 1862"],["6"]],[["10","1 3 3 4 6 7 7 8 9 10"],["7"]],[["10","1952 1862 1812 1746 1675 1627 1488 1390 1324 1137"],["9"]],[["25","1448 4549 2310 2725 2091 3509 1565 2475 2232 3989 4231 779 2967 2702 608 3739 721 1552 2767 530 3114 665 1940 48 4198"],["5"]],[["33","1097 1132 1091 1104 1049 1038 1023 1080 1104 1029 1035 1061 1049 1060 1088 1106 1105 1087 1063 1076 1054 1103 1047 1041 1028 1120 1126 1063 1117 1110 1044 1093 1101"],["5"]],[["34","821 5536 2491 6074 7216 9885 764 1603 778 8736 8987 771 617 1587 8943 7922 439 7367 4115 8886 7878 6899 8811 5752 3184 3401 9760 9400 8995 4681 1323 6637 6554 6498"],["7"]],[["68","6764 6877 6950 6768 6839 6755 6726 6778 6699 6805 6777 6985 6821 6801 6791 6805 6940 6761 6677 6999 6911 6699 6959 6933 6903 6843 6972 6717 6997 6756 6789 6668 6735 6852 6735 6880 6723 6834 6810 6694 6780 6679 6698 6857 6826 6896 6979 6968 6957 6988 6960 6700 6919 6892 6984 6685 6813 6678 6715 6857 6976 6902 6780 6686 6777 6686 6842 6679"],["9"]],[["60","9000 9014 9034 9081 9131 9162 9174 9199 9202 9220 9221 9223 9229 9235 9251 9260 9268 9269 9270 9298 9307 9309 9313 9323 9386 9399 9407 9495 9497 9529 9531 9544 9614 9615 9627 9627 9643 9654 9656 9657 9685 9699 9701 9736 9745 9758 9799 9827 9843 9845 9854 9854 9885 9891 9896 9913 9942 9963 9986 9992"],["57"]],[["100","7 61 12 52 41 16 34 99 30 44 48 89 31 54 21 1 48 52 61 15 35 87 21 76 64 92 44 81 16 93 84 92 32 15 68 76 53 39 26 4 11 26 7 4 99 99 61 65 55 85 65 67 47 39 2 74 63 49 98 87 5 94 22 30 25 42 31 84 49 23 89 60 16 26 92 27 9 57 75 61 94 35 83 47 99 100 63 24 91 88 79 10 15 45 22 64 3 11 89 83"],["4"]],[["100","9999 9999 9999 9998 9998 9998 9997 9996 9996 9995 9993 9993 9991 9990 9989 9986 9984 9984 9983 9981 9981 9980 9980 9980 9979 9977 9977 9977 9977 9977 9976 9976 9975 9975 9973 9972 9972 9972 9972 9971 9969 9969 9969 9968 9967 9965 9962 9962 9962 9962 9960 9958 9958 9955 9954 9954 9954 9954 9950 9949 9949 9947 9943 9943 9940 9940 9939 9937 9937 9937 9936 9935 9932 9932 9931 9929 9927 9927 9926 9923 9919 9919 9918 9918 9918 9917 9917 9916 9916 9915 9914 9911 9910 9907 9907 9906 9905 9905 9904 9901"],["57"]],[["100","158 159 157 156 155 154 160 153 161 152 162 163 151 164 150 165 149 148 147 166 146 167 145 144 143 142 168 141 169 170 140 139 138 137 171 136 135 134 172 173 174 133 175 132 177 178 131 179 180 130 129 181 128 127 182 126 183 125 124 184 123 122 121 120 119 118 117 185 186 187 188 189 116 190 115 191 192 193 114 113 112 111 110 109 108 194 195 107 106 105 196 197 104 198 199 103 102 200 101 100"],["99"]],[["2","0 10000"],["1"]],[["2","5 5"],["0"]],[["2","1 1"],["0"]],[["2","10 10"],["0"]],[["1","0"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_8","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n a,b = strings\n read a and b\n create integer x=0\n for i=0 to size of a exclusive\n if a[i] is equal to b[i] then continue\n if a[i] is equal to 8\n if b[i] is equal to (\n decrement x\n else do the following\n increment x\n end of the block\n else if a[i] is equal to (\n if b[i] is equal to [\n subtract 1 from x\n else do the following\n add 1 to x\n end of the block\n else do the following\n if b[i] is equal to (\n add 1 to x\n else do the following\n decrement x\n end of the block\n end of the block\n if x is 0 then print TIE else if x>0 print TEAM 1 WINS else print TEAM 2 WINS and new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string a, b;\n cin >> a >> b;\n int x = 0;\n for (int i = 0; i < a.size(); i += 2) {\n if (a[i] == b[i]) continue;\n if (a[i] == '8') {\n if (b[i] == '(') {\n x--;\n } else {\n x++;\n }\n } else if (a[i] == '(') {\n if (b[i] == '[') {\n x--;\n } else {\n x++;\n }\n } else {\n if (b[i] == '(')\n x++;\n else\n x--;\n }\n }\n cout << (!x ? \"TIE\\n\" : (x > 0 ? \"TEAM 1 WINS\\n\" : \"TEAM 2 WINS\\n\"));\n return 0;\n}","item":{"problem_id":"409A","pseudocode":"define the main function\n a,b = strings\n read a and b\n create integer x=0\n for i=0 to size of a exclusive\n if a[i] is equal to b[i] then continue\n if a[i] is equal to 8\n if b[i] is equal to (\n decrement x\n else do the following\n increment x\n end of the block\n else if a[i] is equal to (\n if b[i] is equal to [\n subtract 1 from x\n else do the following\n add 1 to x\n end of the block\n else do the following\n if b[i] is equal to (\n add 1 to x\n else do the following\n decrement x\n end of the block\n end of the block\n if x is 0 then print TIE else if x>0 print TEAM 1 WINS else print TEAM 2 WINS and new line\n return to indicate successful execution\nend of the block","testcases":[[["[]()[]8<","8<[]()8<"],["TEAM 2 WINS"]],[["8<8<()","[]8<[]"],["TIE"]],[["()","[]"],["TEAM 2 WINS"]],[["()","8<"],["TEAM 1 WINS"]],[["8<","[]"],["TEAM 1 WINS"]],[["[]8<()()()()8<8<8<[]","()()[][][]8<[]()8<8<"],["TEAM 2 WINS"]],[["()[]()()()","[]()[][]8<"],["TEAM 2 WINS"]],[["()","8<"],["TEAM 1 WINS"]],[["()[][]()()[][]()8<8<","8<[]()()()8<[][]()()"],["TEAM 2 WINS"]],[["()[][]8<","8<()8<()"],["TIE"]],[["8<()8<8<8<8<()8<","[]()()8<()[][][]"],["TIE"]],[["[][]8<8<8<8<","8<[][]()8<()"],["TEAM 2 WINS"]],[["[]","()"],["TEAM 1 WINS"]],[["8<8<8<[]","[][][][]"],["TEAM 1 WINS"]],[["[][]8<[][]8<[]()()()","()()[][]8<[]()8<[][]"],["TEAM 1 WINS"]],[["[]8<8<[]","[]8<()[]"],["TEAM 2 WINS"]],[["[]","[]"],["TIE"]],[["[]8<[]()()()[]","8<[]8<()8<()8<"],["TEAM 2 WINS"]],[["[]()()()8<[]8<[]","[][]8<[]()[][][]"],["TEAM 2 WINS"]],[["8<()8<[]","()[][]()"],["TIE"]],[["()[]()()8<[]8<[]","()()()8<8<()8<[]"],["TEAM 1 WINS"]],[["8<()()()8<8<","[]8<()()[][]"],["TEAM 1 WINS"]],[["()[]()()","()()[]()"],["TIE"]],[["[]8<[]8<[]()","8<[]8<8<[]8<"],["TIE"]],[["8<()()[]()[]","8<8<8<8<[][]"],["TIE"]],[["[][]()[]","[]8<8<[]"],["TIE"]],[["[]()","()()"],["TEAM 1 WINS"]],[["()()()()8<()()()8<","()[][][]8<()[][][]"],["TEAM 2 WINS"]],[["[]8<","8<()"],["TEAM 2 WINS"]],[["8<8<8<","[]()8<"],["TIE"]],[["[]","[]"],["TIE"]],[["()","()"],["TIE"]],[["8<","8<"],["TIE"]],[["()","[]"],["TEAM 2 WINS"]],[["8<","[]"],["TEAM 1 WINS"]]]}} +{"instance_id":"pseudo_to_code_0.5k_9","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create strings n1 and n2\n read n1 and n2\n for i from 0 to length of n1 exclusive\n if n1[i] is equal to n2[i]\n change n1[i] to '0'\n else\n set n1[i] to '1'\n end of the block\n end of the block\n print n1\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string n1, n2;\n cin >> n1 >> n2;\n for (size_t i = 0; i < n1.length(); ++i) {\n if (n1[i] == n2[i]) {\n n1[i] = '0';\n } else {\n n1[i] = '1';\n }\n }\n cout << n1 << endl;\n return 0;\n}","item":{"problem_id":"61A","pseudocode":"define the main function\n create strings n1 and n2\n read n1 and n2\n for i from 0 to length of n1 exclusive\n if n1[i] is equal to n2[i]\n change n1[i] to '0'\n else\n set n1[i] to '1'\n end of the block\n end of the block\n print n1\n return to indicate successful execution\nend of the block","testcases":[[["1010100","0100101"],["1110001"]],[["000","111"],["111"]],[["1110","1010"],["0100"]],[["01110","01100"],["00010"]],[["011101","000001"],["011100"]],[["10","01"],["11"]],[["00111111","11011101"],["11100010"]],[["011001100","101001010"],["110000110"]],[["1100100001","0110101100"],["1010001101"]],[["00011101010","10010100101"],["10001001111"]],[["100000101101","111010100011"],["011010001110"]],[["1000001111010","1101100110001"],["0101101001011"]],[["01011111010111","10001110111010"],["11010001101101"]],[["110010000111100","001100101011010"],["111110101100110"]],[["0010010111110000","0000000011010110"],["0010010100100110"]],[["00111110111110000","01111100001100000"],["01000010110010000"]],[["101010101111010001","001001111101111101"],["100011010010101100"]],[["0110010101111100000","0011000101000000110"],["0101010000111100110"]],[["11110100011101010111","00001000011011000000"],["11111100000110010111"]],[["101010101111101101001","111010010010000011111"],["010000111101101110110"]],[["0000111111100011000010","1110110110110000001010"],["1110001001010011001000"]],[["10010010101000110111000","00101110100110111000111"],["10111100001110001111111"]],[["010010010010111100000111","100100111111100011001110"],["110110101101011111001001"]],[["0101110100100111011010010","0101100011010111001010001"],["0000010111110000010000011"]],[["10010010100011110111111011","10000110101100000001000100"],["00010100001111110110111111"]],[["000001111000000100001000000","011100111101111001110110001"],["011101000101111101111110001"]],[["0011110010001001011001011100","0000101101000011101011001010"],["0011011111001010110010010110"]],[["11111000000000010011001101111","11101110011001010100010000000"],["00010110011001000111011101111"]],[["011001110000110100001100101100","001010000011110000001000101001"],["010011110011000100000100000101"]],[["1011111010001100011010110101111","1011001110010000000101100010101"],["0000110100011100011111010111010"]],[["10111000100001000001010110000001","10111000001100101011011001011000"],["00000000101101101010001111011001"]],[["000001010000100001000000011011100","111111111001010100100001100000111"],["111110101001110101100001111011011"]],[["1101000000000010011011101100000110","1110000001100010011010000011011110"],["0011000001100000000001101111011000"]],[["01011011000010100001100100011110001","01011010111000001010010100001110000"],["00000001111010101011110000010000001"]],[["000011111000011001000110111100000100","011011000110000111101011100111000111"],["011000111110011110101101011011000011"]],[["1001000010101110001000000011111110010","0010001011010111000011101001010110000"],["1011001001111001001011101010101000010"]],[["00011101011001100101111111000000010101","10010011011011001011111000000011101011"],["10001110000010101110000111000011111110"]],[["111011100110001001101111110010111001010","111111101101111001110010000101101000100"],["000100001011110000011101110111010001110"]],[["1111001001101000001000000010010101001010","0010111100111110001011000010111110111001"],["1101110101010110000011000000101011110011"]],[["00100101111000000101011111110010100011010","11101110001010010101001000111110101010100"],["11001011110010010000010111001100001001110"]],[["101011001110110100101001000111010101101111","100111100110101011010100111100111111010110"],["001100101000011111111101111011101010111001"]],[["1111100001100101000111101001001010011100001","1000110011000011110010001011001110001000001"],["0111010010100110110101100010000100010100000"]],[["01100111011111010101000001101110000001110101","10011001011111110000000101011001001101101100"],["11111110000000100101000100110111001100011001"]],[["110010100111000100100101100000011100000011001","011001111011100110000110111001110110100111011"],["101011011100100010100011011001101010100100010"]],[["0001100111111011010110100100111000000111000110","1100101011000000000001010010010111001100110001"],["1101001100111011010111110110101111001011110111"]],[["00000101110110110001110010100001110100000100000","10010000110011110001101000111111101010011010001"],["10010101000101000000011010011110011110011110001"]],[["110000100101011100100011001111110011111110010001","101011111001011100110110111101110011010110101100"],["011011011100000000010101110010000000101000111101"]],[["0101111101011111010101011101000011101100000000111","0000101010110110001110101011011110111001010100100"],["0101010111101001011011110110011101010101010100011"]],[["11000100010101110011101000011111001010110111111100","00001111000111001011111110000010101110111001000011"],["11001011010010111000010110011101100100001110111111"]],[["101000001101111101101111111000001110110010101101010","010011100111100001100000010001100101000000111011011"],["111011101010011100001111101001101011110010010110001"]],[["0011111110010001010100010110111000110011001101010100","0111000000100010101010000100101000000100101000111001"],["0100111110110011111110010010010000110111100101101101"]],[["11101010000110000011011010000001111101000111011111100","10110011110001010100010110010010101001010111100100100"],["01011001110111010111001100010011010100010000111011000"]],[["011000100001000001101000010110100110011110100111111011","111011001000001001110011001111011110111110110011011111"],["100011101001001000011011011001111000100000010100100100"]],[["0111010110010100000110111011010110100000000111110110000","1011100100010001101100000100111111101001110010000100110"],["1100110010000101101010111111101001001001110101110010110"]],[["10101000100111000111010001011011011011110100110101100011","11101111000000001100100011111000100100000110011001101110"],["01000111100111001011110010100011111111110010101100001101"]],[["000000111001010001000000110001001011100010011101010011011","110001101000010010000101000100001111101001100100001010010"],["110001010001000011000101110101000100001011111001011001001"]],[["0101011100111010000111110010101101111111000000111100011100","1011111110000010101110111001000011100000100111111111000111"],["1110100010111000101001001011101110011111100111000011011011"]],[["11001000001100100111100111100100101011000101001111001001101","10111110100010000011010100110100100011101001100000001110110"],["01110110101110100100110011010000001000101100101111000111011"]],[["010111011011101000000110000110100110001110100001110110111011","101011110011101011101101011111010100100001100111100100111011"],["111100101000000011101011011001110010101111000110010010000000"]],[["1001011110110110000100011001010110000100011010010111010101110","1101111100001000010111110011010101111010010100000001000010111"],["0100100010111110010011101010000011111110001110010110010111001"]],[["10000010101111100111110101111000010100110111101101111111111010","10110110101100101010011001011010100110111011101100011001100111"],["00110100000011001101101100100010110010001100000001100110011101"]],[["011111010011111000001010101001101001000010100010111110010100001","011111001011000011111001000001111001010110001010111101000010011"],["000000011000111011110011101000010000010100101000000011010110010"]],[["1111000000110001011101000100100100001111011100001111001100011111","1101100110000101100001100000001001011011111011010101000101001010"],["0010100110110100111100100100101101010100100111011010001001010101"]],[["01100000101010010011001110100110110010000110010011011001100100011","10110110010110111100100111000111000110010000000101101110000010111"],["11010110111100101111101001100001110100010110010110110111100110100"]],[["001111111010000100001100001010011001111110011110010111110001100111","110000101001011000100010101100100110000111100000001101001110010111"],["111111010011011100101110100110111111111001111110011010111111110000"]],[["1011101011101101011110101101011101011000010011100101010101000100110","0001000001001111010111100100111101100000000001110001000110000000110"],["1010101010100010001001001001100000111000010010010100010011000100000"]],[["01000001011001010011011100010000100100110101111011011011110000001110","01011110000110011011000000000011000111100001010000000011111001110000"],["00011111011111001000011100010011100011010100101011011000001001111110"]],[["110101010100110101000001111110110100010010000100111110010100110011100","111010010111111011100110101011001011001110110111110100000110110100111"],["001111000011001110100111010101111111011100110011001010010010000111011"]],[["1001101011000001011111100110010010000011010001001111011100010100110001","1111100111110101001111010001010000011001001001010110001111000000100101"],["0110001100110100010000110111000010011010011000011001010011010100010100"]],[["00000111110010110001110110001010010101000111011001111111100110011110010","00010111110100000100110101000010010001100001100011100000001100010100010"],["00010000000110110101000011001000000100100110111010011111101010001010000"]],[["100101011100101101000011010001011001101110101110001100010001010111001110","100001111100101011011111110000001111000111001011111110000010101110111001"],["000100100000000110011100100001010110101001100101110010010011111001110111"]],[["1101100001000111001101001011101000111000011110000001001101101001111011010","0101011101010100011011010110101000010010110010011110101100000110110001000"],["1000111100010011010110011101000000101010101100011111100001101111001010010"]],[["01101101010011110101100001110101111011100010000010001101111000011110111111","00101111001101001100111010000101110000100101101111100111101110010100011011"],["01000010011110111001011011110000001011000111101101101010010110001010100100"]],[["101100101100011001101111110110110010100110110010100001110010110011001101011","000001011010101011110011111101001110000111000010001101000010010000010001101"],["101101110110110010011100001011111100100001110000101100110000100011011100110"]],[["0010001011001010001100000010010011110110011000100000000100110000101111001110","1100110100111000110100001110111001011101001100001010100001010011100110110001"],["1110111111110010111000001100101010101011010100101010100101100011001001111111"]],[["00101101010000000101011001101011001100010001100000101011101110000001111001000","10010110010111000000101101000011101011001010000011011101101011010000000011111"],["10111011000111000101110100101000100111011011100011110110000101010001111010111"]],[["111100000100100000101001100001001111001010001000001000000111010000010101101011","001000100010100101111011111011010110101100001111011000010011011011100010010110"],["110100100110000101010010011010011001100110000111010000010100001011110111111101"]],[["0110001101100100001111110101101000100101010010101010011001101001001101110000000","0111011000000010010111011110010000000001000110001000011001101000000001110100111"],["0001010101100110011000101011111000100100010100100010000000000001001100000100111"]],[["10001111111001000101001011110101111010100001011010101100111001010001010010001000","10000111010010011110111000111010101100000011110001101111001000111010100000000001"],["00001000101011011011110011001111010110100010101011000011110001101011110010001001"]],[["100110001110110000100101001110000011110110000110000000100011110100110110011001101","110001110101110000000100101001101011111100100100001001000110000001111100011110110"],["010111111011000000100001100111101000001010100010001001100101110101001010000111011"]],[["0000010100100000010110111100011111111010011101000000100000011001001101101100111010","0100111110011101010110101011110110010111001111000110101100101110111100101000111111"],["0100101010111101000000010111101001101101010010000110001100110111110001000100000101"]],[["11000111001010100001110000001001011010010010110000001110100101000001010101100110111","11001100100100100001101010110100000111100011101110011010110100001001000011011011010"],["00001011101110000000011010111101011101110001011110010100010001001000010110111101101"]],[["010110100010001000100010101001101010011010111110100001000100101000111011100010100001","110000011111101101010011111000101010111010100001001100001001100101000000111000000000"],["100110111101100101110001010001000000100000011111101101001101001101111011011010100001"]],[["0000011110101110010101110110110101100001011001101010101001000010000010000000101001101","1100111111011100000110000111101110011111100111110001011001000010011111100001001100011"],["1100100001110010010011110001011011111110111110011011110000000000011101100001100101110"]],[["10100000101101110001100010010010100101100011010010101000110011100000101010110010000000","10001110011011010010111011011101101111000111110000111000011010010101001100000001010011"],["00101110110110100011011001001111001010100100100010010000101001110101100110110011010011"]],[["001110000011111101101010011111000101010111010100001001100001001100101000000111000000000","111010000000000000101001110011001000111011001100101010011001000011101001001011110000011"],["110100000011111101000011101100001101101100011000100011111000001111000001001100110000011"]],[["1110111100111011010101011011001110001010010010110011110010011111000010011111010101100001","1001010101011001001010100010101100000110111101011000100010101111111010111100001110010010"],["0111101001100010011111111001100010001100101111101011010000110000111000100011011011110011"]],[["11100010001100010011001100001100010011010001101110011110100101110010101101011101000111111","01110000000110111010110100001010000101011110100101010011000110101110101101110111011110001"],["10010010001010101001111000000110010110001111001011001101100011011100000000101010011001110"]],[["001101011001100101101100110000111000101011001001100100000100101000100000110100010111111101","101001111110000010111101111110001001111001111101111010000110111000100100110010010001011111"],["100100100111100111010001001110110001010010110100011110000010010000000100000110000110100010"]],[["1010110110010101000110010010110101011101010100011001101011000110000000100011100100011000000","0011011111100010001111101101000111001011101110100000110111100100101111010110101111011100011"],["1001101001110111001001111111110010010110111010111001011100100010101111110101001011000100011"]],[["10010010000111010111011111110010100101100000001100011100111011100010000010010001011100001100","00111010100010110010000100010111010001111110100100100011101000101111111111001101101100100100"],["10101000100101100101011011100101110100011110101000111111010011001101111101011100110000101000"]],[["010101110001010101100000010111010000000111110011001101100011001000000011001111110000000010100","010010111011100101010101111110110000000111000100001101101001001000001100101110001010000100001"],["000111001010110000110101101001100000000000110111000000001010000000001111100001111010000110101"]],[["1100111110011001000111101001001011000110011010111111100010111111001100111111011101100111101011","1100000011001000110100110111000001011001010111101000010010100011000001100100111101101000010110"],["0000111101010001110011011110001010011111001101010111110000011100001101011011100000001111111101"]],[["00011000100100110111100101100100000000010011110111110010101110110011100001010111010011110100101","00011011111011111011100101100111100101001110010111000010000111000100100100000001110101111011011"],["00000011011111001100000000000011100101011101100000110000101001110111000101010110100110001111110"]],[["000101011001001100000111100010110101111011110101111101000110001101011010111110110011100100000001","011000101010011111011000111000100000000011011000000001111110001000001111101010110000011100001111"],["011101110011010011011111011010010101111000101101111100111000000101010101010100000011111000001110"]],[["1000101001011010000100100100010010011101011001110101111011101111111110010101001101010001010101001","0110110010011100011111011111110111000000010001110100001010111110101011010011111011111110000110000"],["1110011011000110011011111011100101011101001000000001110001010001010101000110110110101111010011001"]],[["01111010010101100111110111111011011010100001011101010000111100101101101110111011001100101011100111","00001100110110100001111011000010001001001100000010111101000001111011100000010111010010000011000010"],["01110110100011000110001100111001010011101101011111101101111101010110001110101100011110101000100101"]],[["111101011101111000001011001101111010110111001101110100100011111011011101001101010101011010111000110","101111100101101101001100110011000001111010011101110111110110101110011011110011111100001001110101101"],["010010111000010101000111111110111011001101010000000011010101010101000110111110101001010011001101011"]],[["1010000011010110011101001101110001110010000111011101110010110110111111001001110100101100010101010001","0111101000111100101100000101111010100100001000011101010100110011100011010011010101000100101011100011"],["1101101011101010110001001000001011010110001111000000100110000101011100011010100001101000111110110010"]],[["0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001","1111111010111111101011111110101111111010111111101011111110101111111010111111101011111110101111111010"],["1111111010111111101011111110101111111010111111101011111110101111111010111111101011111110101111111011"]],[["0","0"],["0"]],[["0","1"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_10","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate integer sum\ndeclare gcd with integers a, b as arguments, returning integer\n if a % b is 0, return b from function\n return result of run gcd with arguments b, a %b from function\nend of the block\ndeclare add with integers n, x as arguments, returning void\n while n is not 0\n increment sum by n % x\n set n to n \/ x\n end of the block\nend of the block\ndefine the main function\n create integer n\n read n\n for i = 2 to n exclusive, run add with n, i as arguments\n create integer div with div = result of run gcd with sum, n - 2 as arguments\n print sum \/ div print '\/' print (n - 2)\/div print newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int sum;\nint gcd(int a, int b) {\n if (a % b == 0) return b;\n return gcd(b, a % b);\n}\nvoid add(int n, int x) {\n while (n != 0) {\n sum += n % x;\n n \/= x;\n }\n}\nint main() {\n int n;\n cin >> n;\n for (int i = 2; i < n; i++) add(n, i);\n int div = gcd(sum, n - 2);\n cout << sum \/ div << '\/' << (n - 2) \/ div << endl;\n return 0;\n}","item":{"problem_id":"13A","pseudocode":"create integer sum\ndeclare gcd with integers a, b as arguments, returning integer\n if a % b is 0, return b from function\n return result of run gcd with arguments b, a %b from function\nend of the block\ndeclare add with integers n, x as arguments, returning void\n while n is not 0\n increment sum by n % x\n set n to n \/ x\n end of the block\nend of the block\ndefine the main function\n create integer n\n read n\n for i = 2 to n exclusive, run add with n, i as arguments\n create integer div with div = result of run gcd with sum, n - 2 as arguments\n print sum \/ div print '\/' print (n - 2)\/div print newline\n return to indicate successful execution\nend of the block","testcases":[[["5"],["7\/3"]],[["3"],["2\/1"]],[["1000"],["90132\/499"]],[["927"],["155449\/925"]],[["260"],["6265\/129"]],[["131"],["3370\/129"]],[["386"],["857\/12"]],[["277"],["2864\/55"]],[["766"],["53217\/382"]],[["28"],["85\/13"]],[["406"],["7560\/101"]],[["757"],["103847\/755"]],[["6"],["9\/4"]],[["239"],["10885\/237"]],[["322"],["2399\/40"]],[["98"],["317\/16"]],[["208"],["4063\/103"]],[["786"],["55777\/392"]],[["879"],["140290\/877"]],[["702"],["89217\/700"]],[["948"],["7369\/43"]],[["537"],["52753\/535"]],[["984"],["174589\/982"]],[["934"],["157951\/932"]],[["726"],["95491\/724"]],[["127"],["3154\/125"]],[["504"],["23086\/251"]],[["125"],["3080\/123"]],[["604"],["33178\/301"]],[["115"],["2600\/113"]],[["27"],["167\/25"]],[["687"],["85854\/685"]],[["880"],["69915\/439"]],[["173"],["640\/19"]],[["264"],["6438\/131"]],[["785"],["111560\/783"]],[["399"],["29399\/397"]],[["514"],["6031\/64"]],[["381"],["26717\/379"]],[["592"],["63769\/590"]],[["417"],["32002\/415"]],[["588"],["62723\/586"]],[["852"],["131069\/850"]],[["959"],["5059\/29"]],[["841"],["127737\/839"]],[["733"],["97598\/731"]],[["692"],["87017\/690"]],[["69"],["983\/67"]],[["223"],["556\/13"]],[["93"],["246\/13"]],[["643"],["75503\/641"]],[["119"],["2833\/117"]],[["498"],["1459\/16"]],[["155"],["4637\/153"]],[["305"],["17350\/303"]],[["454"],["37893\/452"]],[["88"],["1529\/86"]],[["850"],["32645\/212"]],[["474"],["20581\/236"]],[["309"],["17731\/307"]],[["762"],["105083\/760"]],[["591"],["63761\/589"]],[["457"],["38317\/455"]],[["141"],["3832\/139"]],[["385"],["27232\/383"]],[["387"],["27628\/385"]],[["469"],["40306\/467"]],[["624"],["35285\/311"]],[["330"],["487\/8"]],[["31"],["222\/29"]],[["975"],["171679\/973"]],[["584"],["62183\/582"]],[["668"],["81127\/666"]],[["331"],["20297\/329"]],[["189"],["6789\/187"]],[["251"],["11939\/249"]],[["876"],["69196\/437"]],[["615"],["68987\/613"]],[["451"],["37258\/449"]],[["499"],["45727\/497"]],[["699"],["89117\/697"]],[["619"],["70019\/617"]],[["413"],["10515\/137"]],[["197"],["7399\/195"]],[["794"],["14281\/99"]],[["659"],["79403\/657"]],[["653"],["77695\/651"]],[["23"],["45\/7"]],[["430"],["16985\/214"]],[["249"],["11659\/247"]],[["837"],["126869\/835"]],[["258"],["12373\/256"]],[["995"],["59665\/331"]],[["102"],["504\/25"]],[["989"],["177124\/987"]],[["376"],["13008\/187"]],[["657"],["15715\/131"]],[["746"],["50509\/372"]],[["602"],["13177\/120"]]]}} +{"instance_id":"pseudo_to_code_0.5k_11","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create multidimensional char array wb of size 10x10\n for i = 1 to 8 inclusive\n for j = 1 to 8 inclusive, read wb[i][j]\n end of the block\n create int judge = 1\n for i = 1 to 8 inclusive\n for j = 1 to 7 inclusive\n if wb[i][j] equals wb[i][j + 1], set judge to 0\n end of the block\n end of the block\n if judge equals 1\n print \"YES\"\n else\n print \"NO\"\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n char wb[10][10];\n for (int i = 1; i <= 8; i++) {\n for (int j = 1; j <= 8; j++) cin >> wb[i][j];\n }\n int judge = 1;\n for (int i = 1; i <= 8; i++) {\n for (int j = 1; j <= 7; j++) {\n if (wb[i][j] == wb[i][j + 1]) { judge = 0; }\n }\n }\n if (judge == 1) {\n cout << \"YES\" << endl;\n } else\n cout << \"NO\" << endl;\n return 0;\n}","item":{"problem_id":"259A","pseudocode":"define the main function\n create multidimensional char array wb of size 10x10\n for i = 1 to 8 inclusive\n for j = 1 to 8 inclusive, read wb[i][j]\n end of the block\n create int judge = 1\n for i = 1 to 8 inclusive\n for j = 1 to 7 inclusive\n if wb[i][j] equals wb[i][j + 1], set judge to 0\n end of the block\n end of the block\n if judge equals 1\n print \"YES\"\n else\n print \"NO\"\n return to indicate successful execution\nend of the block","testcases":[[["WBWBWBWB","BWBWBWBW","BWBWBWBW","BWBWBWBW","WBWBWBWB","WBWBWBWB","BWBWBWBW","WBWBWBWB"],["YES"]],[["WBWBWBWB","WBWBWBWB","BBWBWWWB","BWBWBWBW","BWBWBWBW","BWBWBWWW","BWBWBWBW","BWBWBWBW"],["NO"]],[["BWBWBWBW","WBWBWBWB","BWBWBWBW","BWBWBWBW","WBWBWBWB","WBWBWBWB","WBWBWBWB","WBWBWBWB"],["YES"]],[["BWBWBWBW","WBWBWBWB","BWBWBWBW","WBWBWBWB","BWBWBWBW","WBWBWBWB","WBWBWBWB","WBWBWBWB"],["YES"]],[["WBWBWBWB","BWBWBWBW","BWBWBWBW","WBWBWBWB","BWBWBWBW","BWBWBWBW","BWBWBWBW","BWBWBWBW"],["YES"]],[["WBWBWBWB","WBWBWBWB","BWBWBWBW","WBWBWBWB","WBWBWBWB","WBWBWBWB","WBWBWBWB","BWWWBWBW"],["NO"]],[["BBBBBWWW","WBBWBWWB","WWWWWBWW","BWBWWBWW","BBBWWBWW","BBBBBWBW","WBBBWBWB","WBWBWWWB"],["NO"]],[["BWBWBWBW","BWBWBWBW","BWWWWWBB","BBWBWBWB","WBWBWBWB","WWBWWBWW","BWBWBWBW","WBWWBBBB"],["NO"]],[["WBWBWBWB","WBWBWBWB","WBWBWBWB","BWBWBWBW","WBWBWBWB","BWBWBWBW","WBWBWBWB","WBWWBWBB"],["NO"]],[["WBWBWBWB","BWBWBWBW","WBWBWBWB","BWBWBWBW","WBWBWBWB","WBWBWBWB","BWBWBWBW","BWBWBWBW"],["YES"]],[["WBWBWBWB","WBWBWBWB","BWBWBWBW","WBWBWBWB","BWBWBWBW","WBWBWBWB","BWBWBWBW","BWBWBWBW"],["YES"]],[["WWWWBWWB","BWBWBWBW","BWBWBWBW","WWBWBBBB","BBWWBBBB","BBBWWBBW","BWWWWWWB","BWWBBBWW"],["NO"]],[["WBBWWBWB","BBWBWBWB","BWBWBWBW","BWBWBWBW","WBWBWBBW","WBWBBBBW","BWWWWBWB","BBBBBBBW"],["NO"]],[["BWBWBWBW","BWBWBWBW","BBWWWBBB","WBBBBBWW","WBBBBWBB","WBWBWBWB","WBWWBWWB","WBBWBBWW"],["NO"]],[["WBBBBBWB","BWBWBWBW","BWBWBWBW","WBWBWBWB","WBWBWBWB","BBBBBWBB","WBBWWBWB","BWBWBWBW"],["NO"]],[["BWBWBWBW","BWBWBWBW","BWBWBWBW","WBWBWBWB","WBWBWBWB","BWBWBWBW","BWBWBWBW","WBBWWBWB"],["NO"]],[["BWBWBWBW","WBWBWBWB","BWBWBWBW","BWWWBWBW","WBWBWBWB","WBWBWBWB","BWBWBWBW","WBWBWBBW"],["NO"]],[["WBWBWBWB","WBWBWBWB","BWBWBWBW","BWBWBWBW","BWBWBWBW","BWBWBWBW","WBWBWBWB","BWBWBWBW"],["YES"]],[["BWBWBWBW","WBWBWBWB","BWBWBWBW","BWBWBWBW","BWBWBWBW","BWBWBWBW","WBWBWBWB","BWBWBWBW"],["YES"]],[["BWBWBWBW","BWBWBWBW","WBWBWBWB","BWBWBWBW","WBWBWBWB","BWBWBWBW","WBWBWBWB","BWBWBWBW"],["YES"]],[["WWBBWWBB","BWWBBWWB","BWBWBWBW","WWBBWWWB","WBWWWWBB","WBWWBBWB","BWBBWBWW","BWBWWWWW"],["NO"]],[["WBWBWBWB","WBWBWBWB","WWBBWBBB","WBWBWBWB","WWWWBWWB","WBBBBWWW","BWBWWWBW","WWWBWBBB"],["NO"]],[["WBWBWBWB","BWWBWWWW","WBWBWBWB","BWBWBWBW","WBWBWBWB","WWBBBBBW","WWWBWWBW","WWBBBBWW"],["NO"]],[["BWBWBWBW","BWBBBWWB","WBWBWBWB","BWBWBWBW","BWBWBWBW","BWBWBWBW","WBWBWBWB","BWBWBWBW"],["NO"]],[["BWBWBWBW","BWBWBWBW","WBWBWBWB","WBWBWBWB","WBWBWBWB","BWBWBWBW","WBWBWBWB","BWBWBWBW"],["YES"]],[["BBBBBBBB","BBBBBBBB","BBBBBBBB","BBBBBBBB","WWWWWWWW","WWWWWWWW","WWWWWWWW","WWWWWWWW"],["NO"]],[["BBBBBBBB","BBBBBBBB","BBBBBBBB","BBBBBBBB","BBBBBBBB","BBBBBBBB","BBBBBBBB","BBBBBBBB"],["NO"]],[["BWBWBWBB","BWBWBWBB","BWBWBWBB","BWBWBWBB","BWBWBWBB","BWBWBWBB","BWBWBWBB","BWBWBWBB"],["NO"]],[["WWBWWBWB","BWBWBWBW","WBWBWBWB","BWBWBWBW","WBWBWBWB","BWBWBWBW","WBWBWBWB","BWBWBWBW"],["NO"]],[["WWWWWWWW","BBBBBBBB","WWWWWWWW","BBBBBBBB","WWWWWWWW","BBBBBBBB","WWWWWWWW","BBBBBBBB"],["NO"]],[["BBBBBBBB","BWBWBWBW","BWBWBWBW","BWBWBWBW","WBWBWBWB","WBWBWBWB","BWBWBWBW","WBWBWBWB"],["NO"]],[["BBBBBBBW","BBBBBBBW","BBBBBBBW","BBBBBBBW","BBBBBBBW","BBBBBBBW","BBBBBBBW","BBBBBBBW"],["NO"]],[["BBBWWWWW","WWWBBBBB","BBBWWWWW","WWWBBBBB","BWBWBWBW","WBWBWBWB","BWBWBWBW","WBWBWBWB"],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_12","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n integer as n\n read n\n for i = 0 to less than n do the following\n integer as k = 0\n if i is less than (n \/ 2 then do the following + 1\n set k to i\n else\n set k to n - 1 - i\n for j = 1 to less than or equal to n do the following\n if abs is less than or equal to k then do the following\n output D\n else\n output *\n end of the block\n output endl\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n for (int i = 0; i < n; i++) {\n int k = 0;\n if (i < (n \/ 2) + 1)\n k = i;\n else\n k = n - 1 - i;\n for (int j = 1; j <= n; j++) {\n if (abs(j - (n \/ 2) - 1) <= k)\n cout << \"D\";\n else\n cout << \"*\";\n }\n cout << endl;\n }\n}","item":{"problem_id":"454A","pseudocode":"define the main function\n integer as n\n read n\n for i = 0 to less than n do the following\n integer as k = 0\n if i is less than (n \/ 2 then do the following + 1\n set k to i\n else\n set k to n - 1 - i\n for j = 1 to less than or equal to n do the following\n if abs is less than or equal to k then do the following\n output D\n else\n output *\n end of the block\n output endl\n end of the block\nend of the block","testcases":[[["3"],["*D*","DDD","*D*"]],[["5"],["**D**","*DDD*","DDDDD","*DDD*","**D**"]],[["7"],["***D***","**DDD**","*DDDDD*","DDDDDDD","*DDDDD*","**DDD**","***D***"]],[["11"],["*****D*****","****DDD****","***DDDDD***","**DDDDDDD**","*DDDDDDDDD*","DDDDDDDDDDD","*DDDDDDDDD*","**DDDDDDD**","***DDDDD***","****DDD****","*****D*****"]],[["15"],["*******D*******","******DDD******","*****DDDDD*****","****DDDDDDD****","***DDDDDDDDD***","**DDDDDDDDDDD**","*DDDDDDDDDDDDD*","DDDDDDDDDDDDDDD","*DDDDDDDDDDDDD*","**DDDDDDDDDDD**","***DDDDDDDDD***","****DDDDDDD****","*****DDDDD*****","******DDD******","*******D*******"]],[["21"],["**********D**********","*********DDD*********","********DDDDD********","*******DDDDDDD*******","******DDDDDDDDD******","*****DDDDDDDDDDD*****","****DDDDDDDDDDDDD****","***DDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDD***","****DDDDDDDDDDDDD****","*****DDDDDDDDDDD*****","******DDDDDDDDD******","*******DDDDDDD*******","********DDDDD********","*********DDD*********","**********D**********"]],[["27"],["*************D*************","************DDD************","***********DDDDD***********","**********DDDDDDD**********","*********DDDDDDDDD*********","********DDDDDDDDDDD********","*******DDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDD*******","********DDDDDDDDDDD********","*********DDDDDDDDD*********","**********DDDDDDD**********","***********DDDDD***********","************DDD************","*************D*************"]],[["35"],["*****************D*****************","****************DDD****************","***************DDDDD***************","**************DDDDDDD**************","*************DDDDDDDDD*************","************DDDDDDDDDDD************","***********DDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDD***********","************DDDDDDDDDDD************","*************DDDDDDDDD*************","**************DDDDDDD**************","***************DDDDD***************","****************DDD****************","*****************D*****************"]],[["49"],["************************D************************","***********************DDD***********************","**********************DDDDD**********************","*********************DDDDDDD*********************","********************DDDDDDDDD********************","*******************DDDDDDDDDDD*******************","******************DDDDDDDDDDDDD******************","*****************DDDDDDDDDDDDDDD*****************","****************DDDDDDDDDDDDDDDDD****************","***************DDDDDDDDDDDDDDDDDDD***************","**************DDDDDDDDDDDDDDDDDDDDD**************","*************DDDDDDDDDDDDDDDDDDDDDDD*************","************DDDDDDDDDDDDDDDDDDDDDDDDD************","***********DDDDDDDDDDDDDDDDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDDDDDDDDDDDDDDDD***********","************DDDDDDDDDDDDDDDDDDDDDDDDD************","*************DDDDDDDDDDDDDDDDDDDDDDD*************","**************DDDDDDDDDDDDDDDDDDDDD**************","***************DDDDDDDDDDDDDDDDDDD***************","****************DDDDDDDDDDDDDDDDD****************","*****************DDDDDDDDDDDDDDD*****************","******************DDDDDDDDDDDDD******************","*******************DDDDDDDDDDD*******************","********************DDDDDDDDD********************","*********************DDDDDDD*********************","**********************DDDDD**********************","***********************DDD***********************","************************D************************"]],[["51"],["*************************D*************************","************************DDD************************","***********************DDDDD***********************","**********************DDDDDDD**********************","*********************DDDDDDDDD*********************","********************DDDDDDDDDDD********************","*******************DDDDDDDDDDDDD*******************","******************DDDDDDDDDDDDDDD******************","*****************DDDDDDDDDDDDDDDDD*****************","****************DDDDDDDDDDDDDDDDDDD****************","***************DDDDDDDDDDDDDDDDDDDDD***************","**************DDDDDDDDDDDDDDDDDDDDDDD**************","*************DDDDDDDDDDDDDDDDDDDDDDDDD*************","************DDDDDDDDDDDDDDDDDDDDDDDDDDD************","***********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***********","************DDDDDDDDDDDDDDDDDDDDDDDDDDD************","*************DDDDDDDDDDDDDDDDDDDDDDDDD*************","**************DDDDDDDDDDDDDDDDDDDDDDD**************","***************DDDDDDDDDDDDDDDDDDDDD***************","****************DDDDDDDDDDDDDDDDDDD****************","*****************DDDDDDDDDDDDDDDDD*****************","******************DDDDDDDDDDDDDDD******************","*******************DDDDDDDDDDDDD*******************","********************DDDDDDDDDDD********************","*********************DDDDDDDDD*********************","**********************DDDDDDD**********************","***********************DDDDD***********************","************************DDD************************","*************************D*************************"]]]}} +{"instance_id":"pseudo_to_code_0.5k_13","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n curr is a 2d array of integers 3 by 3 with elements 1, 1, 1, 1, 1, 1, 1, 1, 1\n actions is a 2d array of integers 3 by 3\n for i = 0 to 3 exclusive\n for j = 0 to 3 exclusive, read actions[i][j]\n end of the block\n for i = 0 to 3 exclusive\n for j = 0 to 3 exclusive\n if actions[i][j] is odd\n if curr[i][j] = 1\n set curr[i][j] to 0\n else\n assign 1 to curr[i][j]\n if j is greater than 0\n if curr[i][j - 1] = 1\n assign 0 to curr[i][j - 1]\n else\n assign 1 to curr[i][j - 1]\n end of the block\n if i is greater than 0\n if curr[i - 1][j] = 1\n assign 0 to curr[i - 1][j]\n else\n assign 1 to curr[i - 1][j]\n end of the block\n if j is less than 2\n if curr[i][j + 1] = 1\n change curr[i][j + 1] to 0\n else\n change curr[i][j + 1] to 1\n end of the block\n if i is less than 2\n if curr[i + 1][j] is equal to 1\n assign 0 to curr[i + 1][j]\n else\n assign 1 to curr[i + 1][j]\n end of the block\n end of the block\n end of the block\n end of the block\n for i from 0 to 3 exclusive\n for j = 0 to 3 exclusive, print curr[i][j]\n print new line\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int curr[3][3] = {1, 1, 1, 1, 1, 1, 1, 1, 1};\n int actions[3][3];\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) { cin >> actions[i][j]; }\n }\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n if (actions[i][j] % 2 == 1) {\n if (curr[i][j] == 1)\n curr[i][j] = 0;\n else\n curr[i][j] = 1;\n if (j > 0) {\n if (curr[i][j - 1] == 1)\n curr[i][j - 1] = 0;\n else\n curr[i][j - 1] = 1;\n }\n if (i > 0) {\n if (curr[i - 1][j] == 1)\n curr[i - 1][j] = 0;\n else\n curr[i - 1][j] = 1;\n }\n if (j < 2) {\n if (curr[i][j + 1] == 1)\n curr[i][j + 1] = 0;\n else\n curr[i][j + 1] = 1;\n }\n if (i < 2) {\n if (curr[i + 1][j] == 1)\n curr[i + 1][j] = 0;\n else\n curr[i + 1][j] = 1;\n }\n }\n }\n }\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) { cout << curr[i][j]; }\n cout << endl;\n }\n return 0;\n}","item":{"problem_id":"275A","pseudocode":"define the main function\n curr is a 2d array of integers 3 by 3 with elements 1, 1, 1, 1, 1, 1, 1, 1, 1\n actions is a 2d array of integers 3 by 3\n for i = 0 to 3 exclusive\n for j = 0 to 3 exclusive, read actions[i][j]\n end of the block\n for i = 0 to 3 exclusive\n for j = 0 to 3 exclusive\n if actions[i][j] is odd\n if curr[i][j] = 1\n set curr[i][j] to 0\n else\n assign 1 to curr[i][j]\n if j is greater than 0\n if curr[i][j - 1] = 1\n assign 0 to curr[i][j - 1]\n else\n assign 1 to curr[i][j - 1]\n end of the block\n if i is greater than 0\n if curr[i - 1][j] = 1\n assign 0 to curr[i - 1][j]\n else\n assign 1 to curr[i - 1][j]\n end of the block\n if j is less than 2\n if curr[i][j + 1] = 1\n change curr[i][j + 1] to 0\n else\n change curr[i][j + 1] to 1\n end of the block\n if i is less than 2\n if curr[i + 1][j] is equal to 1\n assign 0 to curr[i + 1][j]\n else\n assign 1 to curr[i + 1][j]\n end of the block\n end of the block\n end of the block\n end of the block\n for i from 0 to 3 exclusive\n for j = 0 to 3 exclusive, print curr[i][j]\n print new line\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["1 0 0","0 0 0","0 0 1"],["001","010","100"]],[["1 0 1","8 8 8","2 0 3"],["010","011","100"]],[["13 85 77","25 50 45","65 79 9"],["000","010","000"]],[["96 95 5","8 84 74","67 31 61"],["011","011","101"]],[["24 54 37","60 63 6","1 84 26"],["110","101","011"]],[["23 10 40","15 6 40","92 80 77"],["101","100","000"]],[["62 74 80","95 74 93","2 47 95"],["010","001","110"]],[["80 83 48","26 0 66","47 76 37"],["000","000","010"]],[["32 15 65","7 54 36","5 51 3"],["111","101","001"]],[["22 97 12","71 8 24","100 21 64"],["100","001","100"]],[["46 37 13","87 0 50","90 8 55"],["111","011","000"]],[["57 43 58","20 82 83","66 16 52"],["111","010","110"]],[["45 56 93","47 51 59","18 51 63"],["101","011","100"]],[["47 66 67","14 1 37","27 81 69"],["001","001","110"]],[["26 69 69","85 18 23","14 22 74"],["110","001","010"]],[["10 70 65","94 27 25","74 66 30"],["111","010","100"]],[["97 1 74","15 99 1","88 68 86"],["001","011","000"]],[["36 48 42","45 41 66","26 64 1"],["001","111","010"]],[["52 81 97","29 77 71","66 11 2"],["100","100","111"]],[["18 66 33","19 49 49","48 46 26"],["011","100","000"]],[["68 79 52","51 39 100","29 14 26"],["110","000","111"]],[["91 69 77","91 26 64","91 88 57"],["001","011","110"]],[["16 69 64","48 21 80","81 51 51"],["010","101","111"]],[["96 14 2","100 18 12","65 34 89"],["111","010","010"]],[["93 95 90","8 59 42","53 13 19"],["100","001","111"]],[["71 84 18","100 19 67","9 76 15"],["010","010","001"]],[["38 93 85","21 88 64","4 96 25"],["111","011","000"]],[["75 20 20","60 5 78","77 4 69"],["011","001","000"]],[["65 70 96","19 6 83","33 37 82"],["100","000","011"]],[["11 13 60","17 13 46","42 21 39"],["000","011","101"]],[["0 0 0","0 0 0","0 0 0"],["111","111","111"]],[["0 0 0","0 1 0","0 0 0"],["101","000","101"]],[["0 0 0","0 0 0","0 0 1"],["111","110","100"]]]}} +{"instance_id":"pseudo_to_code_0.5k_14","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integer count with count = 0, create integer array arr with size 4\n for i = 0 to 4 exclusive, read arr[i]\n for i = 0 to 3 exclusive\n if arr[i] is not 0\n for j = i + 1 to 4 exclusive\n if arr[i] is arr[j] and arr[j] is not 0\n increment count\n set arr[j] to 0\n end of the block\n end of the block\n end of the block\n print count print newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int count = 0, arr[4];\n for (int i = 0; i < 4; i++) cin >> arr[i];\n for (int i = 0; i < 3; i++) {\n if (arr[i] != 0)\n for (int j = i + 1; j < 4; j++) {\n if (arr[i] == arr[j] && arr[j] != 0) {\n count++;\n arr[j] = 0;\n }\n }\n }\n cout << count << endl;\n return 0;\n}","item":{"problem_id":"228A","pseudocode":"define the main function\n create integer count with count = 0, create integer array arr with size 4\n for i = 0 to 4 exclusive, read arr[i]\n for i = 0 to 3 exclusive\n if arr[i] is not 0\n for j = i + 1 to 4 exclusive\n if arr[i] is arr[j] and arr[j] is not 0\n increment count\n set arr[j] to 0\n end of the block\n end of the block\n end of the block\n print count print newline\n return to indicate successful execution\nend of the block","testcases":[[["1 7 3 3"],["1"]],[["7 7 7 7"],["3"]],[["81170865 673572653 756938629 995577259"],["0"]],[["3491663 217797045 522540872 715355328"],["0"]],[["251590420 586975278 916631563 586975278"],["1"]],[["259504825 377489979 588153796 377489979"],["1"]],[["652588203 931100304 931100304 652588203"],["2"]],[["391958720 651507265 391958720 651507265"],["2"]],[["90793237 90793237 90793237 90793237"],["3"]],[["551651653 551651653 551651653 551651653"],["3"]],[["156630260 609654355 668943582 973622757"],["0"]],[["17061017 110313588 434481173 796661222"],["0"]],[["24975422 256716298 337790533 690960249"],["0"]],[["255635360 732742923 798648949 883146723"],["0"]],[["133315691 265159773 734556507 265159773"],["1"]],[["28442865 741657755 978106882 978106882"],["1"]],[["131245479 174845575 497483467 131245479"],["1"]],[["139159884 616215581 958341883 616215581"],["1"]],[["147784432 947653080 947653080 947653080"],["2"]],[["94055790 756126496 756126496 94055790"],["2"]],[["240458500 511952208 240458500 511952208"],["2"]],[["681828506 972810624 972810624 681828506"],["2"]],[["454961014 454961014 454961014 454961014"],["3"]],[["915819430 915819430 915819430 915819430"],["3"]],[["671645142 671645142 671645142 671645142"],["3"]],[["132503558 132503558 132503558 132503558"],["3"]],[["5 5 999999 6"],["1"]],[["1 1 2 5"],["1"]],[["2 1 2 3"],["1"]],[["1 1 3 5"],["1"]],[["1 1 3 3"],["2"]],[["2 2 2 1"],["2"]],[["3 1 1 1"],["2"]],[["1 2 2 2"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_15","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create long long integers x1, y1, x2, y2, x, y\n read x1 read y1 read x2 read y2\n read x ready\n if absolute value of ( x2 - x1 ) % x is not 0 or absolute value of ( y2 - y1 ) % y is not 0\n print \"NO\\n\"\n return to indicate successful execution\n end of the block\n if ((x2-x1) \/ x - (y2-y1) \/ y)%2 is 0\n print \"YES\\n\"\n else\n print \"NO\\n\"\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long int x1, y1, x2, y2, x, y;\n cin >> x1 >> y1 >> x2 >> y2;\n cin >> x >> y;\n if (abs(x2 - x1) % x != 0 || abs(y2 - y1) % y != 0) {\n cout << \"NO\\n\";\n return 0;\n }\n if (((x2 - x1) \/ x - (y2 - y1) \/ y) % 2 == 0)\n cout << \"YES\\n\";\n else\n cout << \"NO\\n\";\n}","item":{"problem_id":"817A","pseudocode":"define the main function\n create long long integers x1, y1, x2, y2, x, y\n read x1 read y1 read x2 read y2\n read x ready\n if absolute value of ( x2 - x1 ) % x is not 0 or absolute value of ( y2 - y1 ) % y is not 0\n print \"NO\\n\"\n return to indicate successful execution\n end of the block\n if ((x2-x1) \/ x - (y2-y1) \/ y)%2 is 0\n print \"YES\\n\"\n else\n print \"NO\\n\"\nend of the block","testcases":[[["0 0 0 6","2 3"],["YES"]],[["1 1 3 6","1 5"],["NO"]],[["5 4 6 -10","1 1"],["NO"]],[["6 -3 -7 -7","1 2"],["NO"]],[["2 -5 -8 8","2 1"],["YES"]],[["70 -81 -17 80","87 23"],["YES"]],[["41 366 218 -240","3456 1234"],["NO"]],[["-61972 -39646 -42371 -24854","573 238"],["NO"]],[["-84870 -42042 94570 98028","8972 23345"],["YES"]],[["-58533 -50999 -1007 -59169","8972 23345"],["NO"]],[["-100000 -100000 100000 100000","100000 100000"],["YES"]],[["-100000 -100000 100000 100000","1 1"],["YES"]],[["5 2 5 3","1 1"],["NO"]],[["5 5 5 5","5 5"],["YES"]],[["0 0 1000 1000","1 1"],["YES"]],[["0 0 0 1","1 1"],["NO"]],[["1 1 4 4","2 2"],["NO"]],[["100000 100000 99999 99999","100000 100000"],["NO"]],[["1 1 1 6","1 5"],["NO"]],[["2 9 4 0","2 3"],["YES"]],[["0 0 0 9","2 3"],["NO"]],[["14 88 14 88","100 500"],["YES"]],[["-1 0 3 0","4 4"],["NO"]],[["0 0 8 9","2 3"],["NO"]],[["-2 5 7 -6","1 1"],["YES"]],[["3 7 -8 8","2 2"],["NO"]],[["-4 -8 -6 -1","1 3"],["NO"]],[["0 8 6 2","1 1"],["YES"]],[["-5 -2 -8 -2","1 1"],["NO"]],[["1 4 -5 0","1 1"],["YES"]],[["8 -4 4 -7","1 2"],["NO"]],[["5 2 2 4","2 2"],["NO"]],[["2 0 -4 6","1 2"],["NO"]],[["-2 6 -5 -4","1 2"],["YES"]],[["-6 5 10 6","2 4"],["NO"]],[["3 -7 1 -8","1 2"],["NO"]],[["4 1 4 -4","9 4"],["NO"]],[["9 -3 -9 -3","2 2"],["NO"]],[["-6 -6 -10 -5","6 7"],["NO"]],[["-5 -2 2 2","1 7"],["NO"]],[["9 0 8 1","7 10"],["NO"]],[["-1 6 -7 -6","6 4"],["YES"]],[["2 2 -3 -3","3 1"],["NO"]],[["2 -6 7 2","2 1"],["NO"]],[["-6 2 -7 -7","1 2"],["NO"]],[["-5 -5 -1 -5","2 2"],["YES"]],[["0 5 3 -6","2 2"],["NO"]],[["0 -6 2 -1","1 1"],["NO"]],[["-6 6 -5 -4","1 2"],["YES"]],[["7 -7 1 -7","2 2"],["NO"]],[["99966 -99952 -99966 99923","1 1"],["NO"]],[["99921 99980 -99956 -99907","3 4"],["NO"]],[["100000 100000 -100000 -100000","1 1"],["YES"]],[["1 0 2 0","5 1"],["NO"]],[["-3 0 -8 0","7 2"],["NO"]],[["-9 4 -5 -1","8 2"],["NO"]],[["-99999 -100000 100000 100000","1 1"],["NO"]],[["0 0 -100 -100","2 2"],["YES"]],[["9 -5 -3 -2","1 4"],["NO"]],[["1 -10 -10 5","7 5"],["NO"]],[["6 -9 -1 -9","1 9"],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_16","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let n, m, x, y be integers\n read n, m, x, and y\n let a be a vector of ints\n set the size of a to n\n let b be a vector of ints\n set the size of b to m\n for i = 0 to n exclusive, read a[i]\n for i = 0 to m exclusive, read b[i]\n let count be an int with value 0\n let result be a vector of ints\n set the size of result to n\n let index be an int with value 0\n for i and j starting at 0, i < n and j < m\n if b[j] < a[i] - x\n increment j\n else if b > a[i] + y\n increment i\n else\n set result[i] to j + 1\n increment i\n increment j\n increment count\n end of the block\n end of the block\n print count\n for i = 1 to result.size() exclusive\n if result[i] is not 0\n print i + 1, then print a space, then print result[i]\n decrement count\n end of the block\n if count is 0 then break\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, m, x, y;\n cin >> n >> m >> x >> y;\n vector a;\n a.resize(n);\n vector b;\n b.resize(m);\n for (int i = 0; i < n; i++) { cin >> a[i]; }\n for (int i = 0; i < m; i++) { cin >> b[i]; }\n int count = 0;\n vector result;\n result.resize(n);\n int index = 0;\n for (int i = 0, j = 0; i < n && j < m;) {\n if (b[j] < a[i] - x) {\n ++j;\n } else if (b[j] > a[i] + y) {\n ++i;\n } else {\n result[i] = j + 1;\n i++;\n j++;\n ++count;\n }\n }\n cout << count << \"\\n\";\n for (int i = 0; i < result.size(); i++) {\n if (result[i] != 0) {\n cout << i + 1 << \" \" << result[i] << \"\\n\";\n count--;\n }\n if (count == 0) break;\n }\n return 0;\n}","item":{"problem_id":"161A","pseudocode":"define the main function\n let n, m, x, y be integers\n read n, m, x, and y\n let a be a vector of ints\n set the size of a to n\n let b be a vector of ints\n set the size of b to m\n for i = 0 to n exclusive, read a[i]\n for i = 0 to m exclusive, read b[i]\n let count be an int with value 0\n let result be a vector of ints\n set the size of result to n\n let index be an int with value 0\n for i and j starting at 0, i < n and j < m\n if b[j] < a[i] - x\n increment j\n else if b > a[i] + y\n increment i\n else\n set result[i] to j + 1\n increment i\n increment j\n increment count\n end of the block\n end of the block\n print count\n for i = 1 to result.size() exclusive\n if result[i] is not 0\n print i + 1, then print a space, then print result[i]\n decrement count\n end of the block\n if count is 0 then break\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["5 3 0 0","1 2 3 3 4","1 3 5"],["2","1 1","3 2"]],[["3 3 2 2","1 5 9","3 5 7"],["3","1 1","2 2","3 3"]],[["1 1 0 0","1","1"],["1","1 1"]],[["1 1 0 0","1","2"],["0"]],[["2 3 1 4","1 5","1 2 2"],["1","1 1"]],[["20 30 1 4","1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 4 4 4 5","1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 4 5 5"],["20","1 1","2 2","3 3","4 4","5 5","6 6","7 7","8 8","9 9","10 10","11 11","12 12","13 15","14 16","15 17","16 18","17 19","18 20","19 21","20 22"]],[["33 23 17 2","1 1 2 2 2 3 3 3 3 3 3 4 4 4 4 4 5 5 5 6 6 7 7 7 8 8 8 8 8 9 9 10 10","1 1 3 3 4 4 4 5 5 6 6 6 7 8 8 8 8 8 8 9 9 10 10"],["23","1 1","2 2","3 3","4 4","5 5","6 6","7 7","8 8","9 9","12 10","13 11","14 12","17 13","20 14","21 15","22 16","23 17","24 18","25 19","26 20","27 21","28 22","29 23"]],[["2 2 1 4","1 4","3 6"],["2","1 1","2 2"]],[["20 20 1 4","1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 4 5 5","3 3 3 3 3 4 4 4 4 4 4 4 4 5 5 5 6 6 7 7"],["20","1 1","2 2","3 3","4 4","5 5","6 6","7 7","8 8","9 9","10 10","11 11","12 12","13 13","14 14","15 15","16 16","17 17","18 18","19 19","20 20"]],[["33 23 17 2","1 1 1 2 3 3 3 3 3 4 4 4 4 5 6 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 8 10 10","10 10 10 11 12 12 12 12 12 13 13 13 13 14 15 15 15 15 15 15 16 16 16"],["5","26 1","27 2","28 3","32 4","33 5"]],[["1 1 1 2","783266931","783266932"],["1","1 1"]],[["2 3 1 4","1 1","3 3 4"],["2","1 1","2 2"]],[["20 30 1 4","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2","3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4"],["20","1 1","2 2","3 3","4 4","5 5","6 6","7 7","8 8","9 9","10 10","11 11","12 12","13 13","14 14","15 15","16 16","17 17","18 18","19 19","20 20"]],[["33 23 17 2","1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 5 5","10 10 10 10 10 10 10 11 11 11 11 11 11 11 12 12 12 12 12 12 13 13 13"],["0"]],[["10 1 1 1","1 1 1 5 5 7 7 8 8 8","3"],["0"]],[["10 1 2 1","1 2 5 8 9 9 9 10 10 10","7"],["1","4 1"]],[["1 1 2 1","7","8"],["1","1 1"]],[["1 1 0 2","9","7"],["0"]],[["2 2 0 2","2 8","3 5"],["1","1 1"]],[["2 2 1 0","5 5","6 7"],["0"]],[["2 2 3 0","8 9","1 5"],["1","1 2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_17","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate integer vector array vec with size 3\ncreate map like from string to integer\ncreate integers diff, ans, a, b, c, create 2d integer array mat with size 10 by 10\ndeclare cal\n create integers sum, i, j, k, with sum = 0\n for i = 0 to 3 exclusive\n for j = 0 to integer casted size of vec[i]\n for k = 0 to integer casted size of vec[i] exclusive, increment sum by mat[vec[i][j]][vec[i][k]]\n end of the block\n return sum from function\nend of the block\ndeclare count with integer now as argument, returning void\n if now is 7\n if size of vec[0] and size of vec[1] and size of vec[2]\n create integer array x with x = { a \/ size of vec[0], b \/ size of vec[1], c \/ size of vec[2] }\n sort elements from x to x + 3\n if x[2] - x[0] is less than diff\n set diff to x[2] - x[0]\n set ans to result of run cal\n else if x[2] - x[0] is diff\n set ans to maximum of ans and result of run cal\n end of the block\n return from function\n end of the block\n for i = 0 to 3 exclusive\n add element now to end of vec[i]\n run count with now + 1 as argument\n remove last element from vec[i]\n end of the block\nend of the block\ndefine the main function\n set like[ \"Anka\" ] to 0\n set like[ \"Chapay\" ] to 1\n set like[ \"Cleo\" ] to 2\n set like[ \"Troll\" ] to 3\n set like[ \"Dracul\" ] to 4\n set like[ \"Snowy\" ] to 5\n set like[ \"Hexadecimal\" ] to 6\n create integers n, i\n create strings name1, str, name2\n while read n is true\n set diff to ( 1 bitshift left 31 ) - 1\n for i = 0 to 3 exclusive, remove all elements from vec[i]\n set bytes from mat to size of mat to value 0\n for i = 0 to n exclusive\n read name1 read str read name2\n increment mat[like[name1]][like[name2]]\n end of the block\n read a read b read c\n run count with 0 as argument\n print diff print \" \" print ans print newline\n end of the block\nend of the block\n\n[CODE]:","reference_output":"vector vec[3];\nmap like;\nint diff, mat[10][10], ans, a, b, c;\nint cal() {\n int sum = 0, i, j, k;\n for (i = 0; i < 3; i++) {\n for (j = 0; j < (int)vec[i].size(); j++)\n for (k = 0; k < (int)vec[i].size(); k++) sum += mat[vec[i][j]][vec[i][k]];\n }\n return sum;\n}\nvoid count(int now) {\n if (now == 7) {\n if (vec[0].size() && vec[1].size() && vec[2].size()) {\n int x[] = {a \/ vec[0].size(), b \/ vec[1].size(), c \/ vec[2].size()};\n sort(x, x + 3);\n if (x[2] - x[0] < diff) {\n diff = x[2] - x[0];\n ans = cal();\n } else if (x[2] - x[0] == diff)\n ans = max(ans, cal());\n }\n return;\n }\n for (int i = 0; i < 3; i++) {\n vec[i].push_back(now);\n count(now + 1);\n vec[i].pop_back();\n }\n}\nint main() {\n like[\"Anka\"] = 0;\n like[\"Chapay\"] = 1;\n like[\"Cleo\"] = 2;\n like[\"Troll\"] = 3;\n like[\"Dracul\"] = 4;\n like[\"Snowy\"] = 5;\n like[\"Hexadecimal\"] = 6;\n int n, i;\n string name1, str, name2;\n while (cin >> n) {\n diff = (1 << 31) - 1;\n for (i = 0; i < 3; i++) vec[i].clear();\n memset(mat, 0, sizeof(mat));\n for (i = 0; i < n; i++) {\n cin >> name1 >> str >> name2;\n mat[like[name1]][like[name2]]++;\n }\n cin >> a >> b >> c;\n count(0);\n cout << diff << \" \" << ans << endl;\n }\n}","item":{"problem_id":"77A","pseudocode":"create integer vector array vec with size 3\ncreate map like from string to integer\ncreate integers diff, ans, a, b, c, create 2d integer array mat with size 10 by 10\ndeclare cal\n create integers sum, i, j, k, with sum = 0\n for i = 0 to 3 exclusive\n for j = 0 to integer casted size of vec[i]\n for k = 0 to integer casted size of vec[i] exclusive, increment sum by mat[vec[i][j]][vec[i][k]]\n end of the block\n return sum from function\nend of the block\ndeclare count with integer now as argument, returning void\n if now is 7\n if size of vec[0] and size of vec[1] and size of vec[2]\n create integer array x with x = { a \/ size of vec[0], b \/ size of vec[1], c \/ size of vec[2] }\n sort elements from x to x + 3\n if x[2] - x[0] is less than diff\n set diff to x[2] - x[0]\n set ans to result of run cal\n else if x[2] - x[0] is diff\n set ans to maximum of ans and result of run cal\n end of the block\n return from function\n end of the block\n for i = 0 to 3 exclusive\n add element now to end of vec[i]\n run count with now + 1 as argument\n remove last element from vec[i]\n end of the block\nend of the block\ndefine the main function\n set like[ \"Anka\" ] to 0\n set like[ \"Chapay\" ] to 1\n set like[ \"Cleo\" ] to 2\n set like[ \"Troll\" ] to 3\n set like[ \"Dracul\" ] to 4\n set like[ \"Snowy\" ] to 5\n set like[ \"Hexadecimal\" ] to 6\n create integers n, i\n create strings name1, str, name2\n while read n is true\n set diff to ( 1 bitshift left 31 ) - 1\n for i = 0 to 3 exclusive, remove all elements from vec[i]\n set bytes from mat to size of mat to value 0\n for i = 0 to n exclusive\n read name1 read str read name2\n increment mat[like[name1]][like[name2]]\n end of the block\n read a read b read c\n run count with 0 as argument\n print diff print \" \" print ans print newline\n end of the block\nend of the block","testcases":[[["3","Troll likes Dracul","Dracul likes Anka","Snowy likes Hexadecimal","210 200 180"],["30 3"]],[["2","Anka likes Chapay","Chapay likes Anka","10000 50 50"],["1950 2"]],[["11","Snowy likes Dracul","Anka likes Dracul","Chapay likes Snowy","Hexadecimal likes Troll","Anka likes Cleo","Chapay likes Dracul","Anka likes Chapay","Snowy likes Troll","Anka likes Hexadecimal","Cleo likes Chapay","Troll likes Cleo","100 100 100"],["17 5"]],[["14","Chapay likes Cleo","Cleo likes Anka","Dracul likes Snowy","Snowy likes Cleo","Chapay likes Anka","Snowy likes Anka","Chapay likes Troll","Troll likes Anka","Anka likes Snowy","Chapay likes Dracul","Dracul likes Anka","Hexadecimal likes Chapay","Snowy likes Dracul","Cleo likes Dracul","15 15 15"],["2 6"]],[["4","Anka likes Cleo","Snowy likes Cleo","Anka likes Hexadecimal","Cleo likes Snowy","1 1 1"],["0 3"]],[["8","Snowy likes Anka","Hexadecimal likes Snowy","Troll likes Dracul","Hexadecimal likes Troll","Snowy likes Troll","Anka likes Snowy","Snowy likes Chapay","Anka likes Chapay","70 70 70"],["12 5"]],[["0","100 300 600"],["50 0"]],[["3","Chapay likes Hexadecimal","Anka likes Cleo","Troll likes Snowy","15 15000 90"],["2985 2"]],[["0","1 1 10000"],["1999 0"]],[["13","Cleo likes Hexadecimal","Cleo likes Snowy","Hexadecimal likes Anka","Anka likes Snowy","Troll likes Snowy","Chapay likes Hexadecimal","Hexadecimal likes Snowy","Snowy likes Chapay","Troll likes Cleo","Anka likes Hexadecimal","Hexadecimal likes Cleo","Chapay likes Dracul","Snowy likes Dracul","1000000000 2000000000 1000000000"],["166666666 6"]],[["12","Cleo likes Hexadecimal","Chapay likes Anka","Hexadecimal likes Cleo","Anka likes Snowy","Anka likes Cleo","Dracul likes Snowy","Anka likes Troll","Snowy likes Anka","Cleo likes Anka","Hexadecimal likes Troll","Hexadecimal likes Chapay","Snowy likes Troll","1000000000 1 2000000000"],["499999999 7"]],[["0","2000000000 2000000000 2000000000"],["333333334 0"]],[["2","Snowy likes Hexadecimal","Troll likes Dracul","2000000000 2000000000 2000000000"],["333333334 2"]],[["12","Snowy likes Chapay","Cleo likes Dracul","Hexadecimal likes Snowy","Hexadecimal likes Anka","Dracul likes Chapay","Cleo likes Troll","Dracul likes Snowy","Snowy likes Dracul","Troll likes Chapay","Dracul likes Anka","Chapay likes Hexadecimal","Troll likes Dracul","436364663 856574374 347564737"],["111742423 6"]],[["12","Anka likes Dracul","Dracul likes Troll","Cleo likes Troll","Snowy likes Hexadecimal","Hexadecimal likes Chapay","Cleo likes Dracul","Cleo likes Chapay","Hexadecimal likes Anka","Snowy likes Cleo","Hexadecimal likes Snowy","Cleo likes Snowy","Chapay likes Snowy","584329075 428752235 675234087"],["77788420 6"]],[["8","Anka likes Chapay","Dracul likes Snowy","Snowy likes Cleo","Cleo likes Anka","Cleo likes Troll","Hexadecimal likes Troll","Troll likes Cleo","Snowy likes Dracul","325432666 254352394 547360304"],["55277237 6"]],[["18","Snowy likes Troll","Chapay likes Hexadecimal","Cleo likes Snowy","Dracul likes Snowy","Snowy likes Chapay","Troll likes Cleo","Snowy likes Anka","Dracul likes Hexadecimal","Hexadecimal likes Anka","Anka likes Hexadecimal","Anka likes Chapay","Troll likes Anka","Anka likes Snowy","Anka likes Troll","Snowy likes Cleo","Hexadecimal likes Troll","Hexadecimal likes Dracul","Cleo likes Anka","20000 1000 20000"],["5666 8"]],[["6","Chapay likes Troll","Troll likes Cleo","Cleo likes Troll","Chapay likes Snowy","Anka likes Snowy","Troll likes Dracul","987499608 272739716 133573597"],["113301305 5"]],[["6","Anka likes Troll","Troll likes Chapay","Troll likes Hexadecimal","Hexadecimal likes Cleo","Snowy likes Hexadecimal","Chapay likes Troll","740076959 230477703 987799796"],["98788895 5"]],[["17","Cleo likes Dracul","Troll likes Cleo","Anka likes Chapay","Anka likes Troll","Chapay likes Snowy","Troll likes Snowy","Chapay likes Dracul","Hexadecimal likes Snowy","Dracul likes Snowy","Troll likes Hexadecimal","Hexadecimal likes Anka","Cleo likes Snowy","Hexadecimal likes Dracul","Snowy likes Chapay","Snowy likes Hexadecimal","Snowy likes Dracul","Dracul likes Troll","112909524 619275170 403563648"],["88872300 9"]],[["1","Hexadecimal likes Chapay","848189141 631955593 79523012"],["203206701 1"]],[["18","Anka likes Troll","Dracul likes Chapay","Hexadecimal likes Dracul","Chapay likes Dracul","Anka likes Hexadecimal","Snowy likes Cleo","Dracul likes Anka","Snowy likes Anka","Snowy likes Hexadecimal","Dracul likes Troll","Dracul likes Snowy","Hexadecimal likes Anka","Chapay likes Hexadecimal","Snowy likes Dracul","Cleo likes Snowy","Chapay likes Cleo","Anka likes Dracul","Troll likes Anka","838821770 712931449 361810998"],["124167182 8"]],[["18","Hexadecimal likes Chapay","Troll likes Dracul","Troll likes Snowy","Cleo likes Dracul","Chapay likes Snowy","Dracul likes Chapay","Cleo likes Snowy","Dracul likes Hexadecimal","Troll likes Anka","Anka likes Troll","Hexadecimal likes Dracul","Chapay likes Hexadecimal","Cleo likes Chapay","Anka likes Hexadecimal","Snowy likes Dracul","Chapay likes Troll","Anka likes Snowy","Dracul likes Cleo","240256138 922743697 38909902"],["191776022 10"]],[["0","477107314 230715335 261545417"],["43678104 0"]],[["16","Chapay likes Snowy","Hexadecimal likes Anka","Chapay likes Troll","Dracul likes Cleo","Troll likes Hexadecimal","Hexadecimal likes Dracul","Chapay likes Cleo","Snowy likes Cleo","Snowy likes Anka","Troll likes Chapay","Snowy likes Hexadecimal","Troll likes Snowy","Cleo likes Hexadecimal","Anka likes Snowy","Snowy likes Chapay","Anka likes Dracul","843382501 58524777 503038818"],["192994632 8"]],[["5","Troll likes Chapay","Anka likes Snowy","Anka likes Dracul","Chapay likes Anka","Snowy likes Troll","709201888 431802832 597079932"],["82638550 3"]],[["18","Cleo likes Snowy","Snowy likes Hexadecimal","Cleo likes Hexadecimal","Troll likes Dracul","Hexadecimal likes Snowy","Dracul likes Troll","Chapay likes Anka","Chapay likes Cleo","Troll likes Chapay","Hexadecimal likes Chapay","Anka likes Snowy","Troll likes Snowy","Dracul likes Snowy","Dracul likes Chapay","Chapay likes Troll","Cleo likes Troll","Hexadecimal likes Cleo","Anka likes Chapay","864225278 509037060 402199775"],["86975205 9"]],[["12","Cleo likes Hexadecimal","Troll likes Cleo","Anka likes Cleo","Hexadecimal likes Troll","Anka likes Snowy","Hexadecimal likes Anka","Troll likes Hexadecimal","Troll likes Anka","Dracul likes Cleo","Cleo likes Troll","Dracul likes Troll","Chapay likes Anka","762445890 377707484 324080158"],["92108551 6"]],[["21","Chapay likes Dracul","Snowy likes Chapay","Snowy likes Troll","Cleo likes Chapay","Cleo likes Troll","Chapay likes Cleo","Snowy likes Anka","Dracul likes Anka","Troll likes Snowy","Snowy likes Cleo","Chapay likes Hexadecimal","Cleo likes Anka","Cleo likes Snowy","Hexadecimal likes Cleo","Hexadecimal likes Snowy","Hexadecimal likes Anka","Hexadecimal likes Troll","Anka likes Snowy","Dracul likes Troll","Chapay likes Anka","Snowy likes Hexadecimal","482557397 502108264 750230216"],["9775434 8"]],[["6","Troll likes Chapay","Hexadecimal likes Snowy","Cleo likes Dracul","Cleo likes Anka","Chapay likes Anka","Anka likes Chapay","758376921 432619768 578580897"],["72980564 5"]],[["5","Chapay likes Cleo","Anka likes Hexadecimal","Anka likes Chapay","Cleo likes Troll","Anka likes Cleo","299076810 225593528 36830738"],["62861532 3"]],[["13","Anka likes Cleo","Cleo likes Troll","Chapay likes Cleo","Snowy likes Troll","Chapay likes Anka","Chapay likes Snowy","Snowy likes Chapay","Anka likes Snowy","Snowy likes Dracul","Cleo likes Hexadecimal","Dracul likes Chapay","Anka likes Hexadecimal","Snowy likes Cleo","554338888 280967932 682619964"],["96188303 7"]],[["17","Hexadecimal likes Chapay","Chapay likes Snowy","Chapay likes Troll","Anka likes Hexadecimal","Cleo likes Troll","Snowy likes Cleo","Cleo likes Anka","Cleo likes Hexadecimal","Anka likes Snowy","Chapay likes Hexadecimal","Anka likes Cleo","Dracul likes Snowy","Chapay likes Anka","Troll likes Hexadecimal","Troll likes Anka","Anka likes Dracul","Hexadecimal likes Anka","828886798 548024213 166661324"],["107350782 9"]],[["2","Troll likes Cleo","Anka likes Cleo","14344913 559182022 405430772"],["172049094 2"]],[["22","Cleo likes Snowy","Cleo likes Troll","Chapay likes Dracul","Snowy likes Troll","Dracul likes Chapay","Dracul likes Snowy","Chapay likes Cleo","Snowy likes Chapay","Dracul likes Troll","Anka likes Hexadecimal","Snowy likes Anka","Hexadecimal likes Cleo","Hexadecimal likes Troll","Dracul likes Anka","Cleo likes Hexadecimal","Hexadecimal likes Dracul","Chapay likes Troll","Chapay likes Hexadecimal","Anka likes Snowy","Troll likes Hexadecimal","Snowy likes Hexadecimal","Anka likes Chapay","458053183 602148195 994999698"],["102639975 9"]],[["5","Troll likes Dracul","Anka likes Chapay","Cleo likes Anka","Chapay likes Cleo","Snowy likes Hexadecimal","222 400 400"],["89 5"]],[["0","2000000000 2000000000 1"],["666666665 0"]],[["0","1200000000 1200000000 1200000000"],["200000000 0"]],[["0","1 2000000000 2000000000"],["666666665 0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_18","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate constant integer inf with inf = integer casted 1e9\ncreate constant integer mod with mod = inf + 7\ncreate constant double eps with eps = 1e-9\ncreate constant double pi with pi = acosign of -1.0\ncreate integers r, g, b\ndefine the main function\n read r read g read b\n create integer ans with ans = 30\n for i = 1 to 100000 exclusive\n if i % 3 is 1\n increment ans\n decrement r by 2\n end of the block\n if i % 3 is 2\n increment ans\n decrement g by 2\n end of the block\n if i % 3 is 0\n increment ans\n decrement b by 2\n end of the block\n if r is less than or equal to 0 and g is less than or equal to 0 and b is less than or equal to 0, return print ans -1 print newline, 0 from function\n end of the block\nend of the block\n\n[CODE]:","reference_output":"const int inf = (int)1e9;\nconst int mod = inf + 7;\nconst double eps = 1e-9;\nconst double pi = acos(-1.0);\nint r, g, b;\nint main() {\n cin >> r >> g >> b;\n int ans = 30;\n for (int i = 1; i < 100000; ++i) {\n if (i % 3 == 1) {\n ans++;\n r -= 2;\n }\n if (i % 3 == 2) {\n ans++;\n g -= 2;\n }\n if (i % 3 == 0) {\n ans++;\n b -= 2;\n }\n if (r <= 0 && g <= 0 && b <= 0) return cout << ans - 1 << endl, 0;\n }\n}","item":{"problem_id":"90A","pseudocode":"create constant integer inf with inf = integer casted 1e9\ncreate constant integer mod with mod = inf + 7\ncreate constant double eps with eps = 1e-9\ncreate constant double pi with pi = acosign of -1.0\ncreate integers r, g, b\ndefine the main function\n read r read g read b\n create integer ans with ans = 30\n for i = 1 to 100000 exclusive\n if i % 3 is 1\n increment ans\n decrement r by 2\n end of the block\n if i % 3 is 2\n increment ans\n decrement g by 2\n end of the block\n if i % 3 is 0\n increment ans\n decrement b by 2\n end of the block\n if r is less than or equal to 0 and g is less than or equal to 0 and b is less than or equal to 0, return print ans -1 print newline, 0 from function\n end of the block\nend of the block","testcases":[[["1 3 2"],["34"]],[["3 2 1"],["33"]],[["3 5 2"],["37"]],[["10 10 10"],["44"]],[["29 7 24"],["72"]],[["28 94 13"],["169"]],[["90 89 73"],["163"]],[["0 0 1"],["32"]],[["0 0 2"],["32"]],[["0 1 0"],["31"]],[["0 1 1"],["32"]],[["0 1 2"],["32"]],[["0 2 0"],["31"]],[["0 2 1"],["32"]],[["0 2 2"],["32"]],[["1 0 0"],["30"]],[["1 0 1"],["32"]],[["1 0 2"],["32"]],[["1 1 0"],["31"]],[["1 1 1"],["32"]],[["1 1 2"],["32"]],[["1 2 0"],["31"]],[["1 2 1"],["32"]],[["1 2 2"],["32"]],[["2 0 0"],["30"]],[["2 0 1"],["32"]],[["2 0 2"],["32"]],[["2 1 0"],["31"]],[["2 1 1"],["32"]],[["2 1 2"],["32"]],[["2 2 0"],["31"]],[["2 2 1"],["32"]],[["2 2 2"],["32"]],[["4 5 2"],["37"]],[["5 7 8"],["41"]],[["13 25 19"],["67"]],[["29 28 30"],["74"]],[["45 52 48"],["106"]],[["68 72 58"],["136"]],[["89 92 90"],["166"]],[["99 97 98"],["177"]],[["89 97 2"],["175"]],[["96 3 92"],["171"]],[["1 99 87"],["178"]],[["95 2 3"],["171"]],[["2 97 3"],["175"]],[["2 2 99"],["179"]],[["100 100 100"],["179"]],[["100 0 100"],["179"]],[["0 100 100"],["179"]],[["100 100 0"],["178"]],[["100 0 0"],["177"]],[["0 100 0"],["178"]],[["0 0 100"],["179"]],[["5 4 5"],["38"]]]}} +{"instance_id":"pseudo_to_code_0.5k_19","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare const int INF = 0x3f3f3f3f\ncreate const long long INFLL = 0x3f3f3f3f3f3f3f3fLL\ninlined long long function read\n create long longs x = 0 and f = 1\n read char from the input to the new char variable ch\n while ch is not a digit character\n if ch = '-', assign -1 to f\n read char from the input to ch\n end of the block\n while ch is a digit character\n assign x * 10 + ch - '0' to x\n read char from the input to ch\n end of the block\n return x * f\nend of the block\ndeclare const int maxn = 1e5 + 10\ncreate integers m and k\ndeclare integer arrays d, mx and s with size maxn\ndefine the main function\n read m and k\n loop i from 1 to m inclusive read d[i]\n for i = 1 to m inclusive\n read s[i]\n change mx[i] to max(mx[i - 1], s[i])\n end of the block\n declare ints ans = 0 and now = s[1]\n for i = 1 to m inclusive\n while d[i] > now, increment now by mx[i] and ans by k\n subtract d[i] from now\n increase now by s[i + 1]\n increase ans by d[i]\n end of the block\n print ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int INF = 0x3f3f3f3f;\nconst long long INFLL = 0x3f3f3f3f3f3f3f3fLL;\ninline long long read() {\n long long x = 0, f = 1;\n char ch = getchar();\n while (ch < '0' || ch > '9') {\n if (ch == '-') f = -1;\n ch = getchar();\n }\n while (ch >= '0' && ch <= '9') {\n x = x * 10 + ch - '0';\n ch = getchar();\n }\n return x * f;\n}\nconst int maxn = 1e5 + 10;\nint m, k;\nint d[maxn], mx[maxn], s[maxn];\nint main() {\n cin >> m >> k;\n for (int i = 1; i <= m; i++) cin >> d[i];\n for (int i = 1; i <= m; i++) {\n cin >> s[i];\n mx[i] = max(mx[i - 1], s[i]);\n }\n int ans = 0, now = s[1];\n for (int i = 1; i <= m; i++) {\n while (d[i] > now) now += mx[i], ans += k;\n now -= d[i];\n now += s[i + 1];\n ans += d[i];\n }\n cout << ans << endl;\n return 0;\n}","item":{"problem_id":"241A","pseudocode":"declare const int INF = 0x3f3f3f3f\ncreate const long long INFLL = 0x3f3f3f3f3f3f3f3fLL\ninlined long long function read\n create long longs x = 0 and f = 1\n read char from the input to the new char variable ch\n while ch is not a digit character\n if ch = '-', assign -1 to f\n read char from the input to ch\n end of the block\n while ch is a digit character\n assign x * 10 + ch - '0' to x\n read char from the input to ch\n end of the block\n return x * f\nend of the block\ndeclare const int maxn = 1e5 + 10\ncreate integers m and k\ndeclare integer arrays d, mx and s with size maxn\ndefine the main function\n read m and k\n loop i from 1 to m inclusive read d[i]\n for i = 1 to m inclusive\n read s[i]\n change mx[i] to max(mx[i - 1], s[i])\n end of the block\n declare ints ans = 0 and now = s[1]\n for i = 1 to m inclusive\n while d[i] > now, increment now by mx[i] and ans by k\n subtract d[i] from now\n increase now by s[i + 1]\n increase ans by d[i]\n end of the block\n print ans\n return to indicate successful execution\nend of the block","testcases":[[["4 6","1 2 5 2","2 3 3 4"],["10"]],[["2 3","5 6","5 5"],["14"]],[["24 3","11 8 8 12 17 4 4 25 39 37 31 32 38 34 29 29 34 39 39 39 17 9 24 6","3 5 4 3 3 3 4 3 4 3 3 3 3 4 3 3 4 3 4 3 3 3 3 3"],["862"]],[["43 5","6 7 15 12 15 7 22 33 38 15 7 23 31 21 26 41 25 14 26 33 5 28 22 6 35 17 19 32 41 27 20 25 5 32 37 19 40 9 25 22 10 24 9","3 5 3 6 5 4 5 3 3 3 3 6 6 3 3 3 3 3 3 3 3 6 3 3 4 3 4 3 6 4 3 6 3 4 6 3 4 5 4 4 3 3 5"],["1566"]],[["62 5","12 12 10 7 27 7 32 15 33 3 23 13 24 30 32 22 21 31 27 27 37 7 5 31 19 16 10 20 24 32 36 42 33 14 41 8 13 3 8 8 12 27 36 15 24 17 23 33 31 5 32 17 14 41 37 31 23 31 41 23 36 12","4 5 4 3 4 3 5 3 4 3 3 3 3 3 3 3 3 3 5 3 4 3 6 4 4 5 3 4 3 3 3 4 3 5 5 3 4 3 3 3 3 5 3 3 5 3 6 3 3 3 3 4 3 3 4 3 5 3 3 3 4 3"],["2406"]],[["81 4","15 20 14 10 39 4 26 8 8 30 13 43 7 7 4 6 23 42 24 35 12 19 21 31 5 20 8 17 25 31 8 31 9 14 29 35 39 35 19 13 35 11 24 3 22 3 22 41 26 32 17 42 21 16 15 44 12 5 16 20 19 38 15 11 36 14 6 21 5 27 15 40 6 9 32 33 35 4 10 15 26","3 5 4 3 4 6 4 7 5 4 3 4 3 3 4 3 4 3 3 4 6 5 5 3 3 6 6 5 3 3 5 3 3 6 4 4 3 6 4 3 3 5 6 6 7 3 3 3 3 3 7 3 3 5 3 3 3 4 6 4 6 4 5 3 3 6 4 3 3 3 7 5 4 5 3 5 4 3 3 4 3"],["2419"]],[["100 6","15 20 32 8 29 10 33 15 9 26 28 21 34 7 41 23 9 17 16 15 14 29 25 31 24 26 13 18 19 40 9 16 36 32 39 11 4 31 37 28 32 40 7 18 45 21 15 45 6 15 27 22 27 41 28 7 22 43 25 40 6 7 32 31 36 14 5 27 31 28 23 9 13 14 7 25 28 33 40 22 44 9 29 26 41 30 16 15 31 42 13 40 36 44 17 29 32 29 38 13","4 4 3 4 3 4 3 3 4 3 4 4 5 6 5 3 3 5 3 5 3 3 5 6 3 4 4 5 4 3 4 3 3 4 4 4 3 5 4 4 4 4 3 3 4 4 6 4 4 5 6 6 4 4 3 5 3 4 3 6 5 3 5 4 4 4 4 3 5 4 3 5 3 3 3 4 3 4 5 4 3 6 5 3 7 3 5 4 5 4 3 5 5 3 5 4 3 5 3 4"],["4491"]],[["80 3","11 48 30 12 7 45 16 36 8 14 16 34 4 41 10 20 10 26 42 40 14 9 40 24 10 6 19 25 4 5 17 33 28 43 19 23 47 32 4 13 25 14 25 28 10 16 37 10 31 30 29 25 7 15 13 25 10 14 33 34 11 27 29 9 39 24 37 34 44 35 47 27 24 24 30 34 25 48 38 48","6 4 3 5 5 3 7 3 3 3 5 3 3 3 4 4 5 4 6 6 4 4 3 5 4 7 6 5 3 4 4 3 3 3 8 3 4 7 8 5 7 3 4 3 4 5 4 3 3 4 3 5 3 4 3 5 3 4 3 5 3 5 5 5 8 3 4 4 4 3 3 3 8 4 5 5 3 4 4 4"],["2595"]],[["100 5","49 53 53 56 41 32 5 13 17 78 94 2 29 1 16 34 89 88 73 35 60 93 5 58 16 26 27 1 6 48 89 54 73 43 53 93 52 27 4 55 2 27 62 2 71 46 15 35 47 53 77 57 23 72 45 97 59 75 52 4 51 23 48 40 16 2 97 40 51 3 91 96 82 95 84 34 58 50 24 97 75 72 3 49 44 81 7 24 32 24 83 25 66 45 50 20 9 21 19 17","8 7 7 7 8 6 4 5 4 6 7 9 8 3 8 9 7 8 4 8 8 6 5 6 7 4 9 5 7 3 8 8 4 5 4 5 6 8 3 6 7 5 3 6 4 8 6 3 9 3 7 3 8 6 6 3 5 8 7 6 9 7 3 4 8 7 7 6 9 7 3 7 4 7 7 3 3 5 8 9 3 5 3 7 4 6 5 7 8 9 9 6 4 3 5 3 6 7 6 5"],["6715"]]]}} +{"instance_id":"pseudo_to_code_0.5k_20","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare string variable str\n read input to str\n change str[0] to uppercase\n print str\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string str;\n cin >> str;\n str[0] = (char)toupper(str[0]);\n cout << str << endl;\n return 0;\n}","item":{"problem_id":"281A","pseudocode":"define the main function\n declare string variable str\n read input to str\n change str[0] to uppercase\n print str\n return to indicate successful execution\nend of the block","testcases":[[["ApPLe"],["ApPLe"]],[["konjac"],["Konjac"]],[["a"],["A"]],[["A"],["A"]],[["z"],["Z"]],[["ABACABA"],["ABACABA"]],[["xYaPxPxHxGePfGtQySlNrLxSjDtNnTaRaEpAhPaQpWnDzMqGgRgEwJxGiBdZnMtHxFbObCaGiCeZkUqIgBhHtNvAqAlHpMnQhNeQbMyZrCdElVwHtKrPpJjIaHuIlYwHaRkAkUpPlOhNlBtXwDsKzPyHrPiUwNlXtTaPuMwTqYtJySgFoXvLiHbQwMjSvXsQfKhVlOxGdQkWjBhEyQvBjPoFkThNeRhTuIzFjInJtEfPjOlOsJpJuLgLzFnZmKvFgFrNsOnVqFcNiMfCqTpKnVyLwNqFiTySpWeTdFnWuTwDkRjVxNyQvTrOoEiExYiFaIrLoFmJfZcDkHuWjYfCeEqCvEsZiWnJaEmFbMjDvYwEeJeGcKbVbChGsIzNlExHzHiTlHcSaKxLuZxX"],["XYaPxPxHxGePfGtQySlNrLxSjDtNnTaRaEpAhPaQpWnDzMqGgRgEwJxGiBdZnMtHxFbObCaGiCeZkUqIgBhHtNvAqAlHpMnQhNeQbMyZrCdElVwHtKrPpJjIaHuIlYwHaRkAkUpPlOhNlBtXwDsKzPyHrPiUwNlXtTaPuMwTqYtJySgFoXvLiHbQwMjSvXsQfKhVlOxGdQkWjBhEyQvBjPoFkThNeRhTuIzFjInJtEfPjOlOsJpJuLgLzFnZmKvFgFrNsOnVqFcNiMfCqTpKnVyLwNqFiTySpWeTdFnWuTwDkRjVxNyQvTrOoEiExYiFaIrLoFmJfZcDkHuWjYfCeEqCvEsZiWnJaEmFbMjDvYwEeJeGcKbVbChGsIzNlExHzHiTlHcSaKxLuZxX"]],[["rZhIcQlXpNcPgXrOjTiOlMoTgXgIhCfMwZfWoFzGhEkQlOoMjIuShPlZfWkNnMyQfYdUhVgQuSmYoElEtZpDyHtOxXgCpWbZqSbYnPqBcNqRtPgCnJnAyIvNsAhRbNeVlMwZyRyJnFgIsCnSbOdLvUyIeOzQvRpMoMoHfNhHwKvTcHuYnYySfPmAiNwAiWdZnWlLvGfBbRbRrCrBqIgIdWkWiBsNyYkKdNxZdGaToSsDnXpRaGrKxBpQsCzBdQgZzBkGeHgGxNrIyQlSzWsTmSnZwOcHqQpNcQvJlPvKaPiQaMaYsQjUeCqQdCjPgUbDmWiJmNiXgExLqOcCtSwSePnUxIuZfIfBeWbEiVbXnUsPwWyAiXyRbZgKwOqFfCtQuKxEmVeRlAkOeXkO"],["RZhIcQlXpNcPgXrOjTiOlMoTgXgIhCfMwZfWoFzGhEkQlOoMjIuShPlZfWkNnMyQfYdUhVgQuSmYoElEtZpDyHtOxXgCpWbZqSbYnPqBcNqRtPgCnJnAyIvNsAhRbNeVlMwZyRyJnFgIsCnSbOdLvUyIeOzQvRpMoMoHfNhHwKvTcHuYnYySfPmAiNwAiWdZnWlLvGfBbRbRrCrBqIgIdWkWiBsNyYkKdNxZdGaToSsDnXpRaGrKxBpQsCzBdQgZzBkGeHgGxNrIyQlSzWsTmSnZwOcHqQpNcQvJlPvKaPiQaMaYsQjUeCqQdCjPgUbDmWiJmNiXgExLqOcCtSwSePnUxIuZfIfBeWbEiVbXnUsPwWyAiXyRbZgKwOqFfCtQuKxEmVeRlAkOeXkO"]],[["hDgZlUmLhYbLkLcNcKeOwJwTePbOvLaRvNzQbSbLsPeHqLhUqWtUbNdQfQqFfXeJqJwWuOrFnDdZiPxIkDyVmHbHvXfIlFqSgAcSyWbOlSlRuPhWdEpEzEeLnXwCtWuVcHaUeRgCiYsIvOaIgDnFuDbRnMoCmPrZfLeFpSjQaTfHgZwZvAzDuSeNwSoWuJvLqKqAuUxFaCxFfRcEjEsJpOfCtDiVrBqNsNwPuGoRgPzRpLpYnNyQxKaNnDnYiJrCrVcHlOxPiPcDbEgKfLwBjLhKcNeMgJhJmOiJvPfOaPaEuGqWvRbErKrIpDkEoQnKwJnTlStLyNsHyOjZfKoIjXwUvRrWpSyYhRpQdLqGmErAiNcGqAqIrTeTiMuPmCrEkHdBrLyCxPtYpRqD"],["HDgZlUmLhYbLkLcNcKeOwJwTePbOvLaRvNzQbSbLsPeHqLhUqWtUbNdQfQqFfXeJqJwWuOrFnDdZiPxIkDyVmHbHvXfIlFqSgAcSyWbOlSlRuPhWdEpEzEeLnXwCtWuVcHaUeRgCiYsIvOaIgDnFuDbRnMoCmPrZfLeFpSjQaTfHgZwZvAzDuSeNwSoWuJvLqKqAuUxFaCxFfRcEjEsJpOfCtDiVrBqNsNwPuGoRgPzRpLpYnNyQxKaNnDnYiJrCrVcHlOxPiPcDbEgKfLwBjLhKcNeMgJhJmOiJvPfOaPaEuGqWvRbErKrIpDkEoQnKwJnTlStLyNsHyOjZfKoIjXwUvRrWpSyYhRpQdLqGmErAiNcGqAqIrTeTiMuPmCrEkHdBrLyCxPtYpRqD"]],[["qUdLgGrJeGmIzIeZrCjUtBpYfRvNdXdRpGsThIsEmJjTiMqEwRxBeBaSxEuWrNvExKePjPnXhPzBpWnHiDhTvZhBuIjDnZpTcEkCvRkAcTmMuXhGgErWgFyGyToOyVwYlCuQpTfJkVdWmFyBqQhJjYtXrBbFdHzDlGsFbHmHbFgXgFhIyDhZyEqEiEwNxSeByBwLiVeSnCxIdHbGjOjJrZeVkOzGeMmQrJkVyGhDtCzOlPeAzGrBlWwEnAdUfVaIjNrRyJjCnHkUvFuKuKeKbLzSbEmUcXtVkZzXzKlOrPgQiDmCcCvIyAdBwOeUuLbRmScNcWxIkOkJuIsBxTrIqXhDzLcYdVtPgZdZfAxTmUtByGiTsJkSySjXdJvEwNmSmNoWsChPdAzJrBoW"],["QUdLgGrJeGmIzIeZrCjUtBpYfRvNdXdRpGsThIsEmJjTiMqEwRxBeBaSxEuWrNvExKePjPnXhPzBpWnHiDhTvZhBuIjDnZpTcEkCvRkAcTmMuXhGgErWgFyGyToOyVwYlCuQpTfJkVdWmFyBqQhJjYtXrBbFdHzDlGsFbHmHbFgXgFhIyDhZyEqEiEwNxSeByBwLiVeSnCxIdHbGjOjJrZeVkOzGeMmQrJkVyGhDtCzOlPeAzGrBlWwEnAdUfVaIjNrRyJjCnHkUvFuKuKeKbLzSbEmUcXtVkZzXzKlOrPgQiDmCcCvIyAdBwOeUuLbRmScNcWxIkOkJuIsBxTrIqXhDzLcYdVtPgZdZfAxTmUtByGiTsJkSySjXdJvEwNmSmNoWsChPdAzJrBoW"]],[["kHbApGoBcLmIwUlXkVgUmWzYeLoDbGaOkWbIuXoRwMfKuOoMzAoXrBoTvYxGrMbRjDuRxAbGsTnErIiHnHoLeRnTbFiRfDdOkNlWiAcOsChLdLqFqXlDpDoDtPxXqAmSvYgPvOcCpOlWtOjYwFkGkHuCaHwZcFdOfHjBmIxTeSiHkWjXyFcCtOlSuJsZkDxUgPeZkJwMmNpErUlBcGuMlJwKkWnOzFeFiSiPsEvMmQiCsYeHlLuHoMgBjFoZkXlObDkSoQcVyReTmRsFzRhTuIvCeBqVsQdQyTyZjStGrTyDcEcAgTgMiIcVkLbZbGvWeHtXwEqWkXfTcPyHhHjYwIeVxLyVmHmMkUsGiHmNnQuMsXaFyPpVqNrBhOiWmNkBbQuHvQdOjPjKiZcL"],["KHbApGoBcLmIwUlXkVgUmWzYeLoDbGaOkWbIuXoRwMfKuOoMzAoXrBoTvYxGrMbRjDuRxAbGsTnErIiHnHoLeRnTbFiRfDdOkNlWiAcOsChLdLqFqXlDpDoDtPxXqAmSvYgPvOcCpOlWtOjYwFkGkHuCaHwZcFdOfHjBmIxTeSiHkWjXyFcCtOlSuJsZkDxUgPeZkJwMmNpErUlBcGuMlJwKkWnOzFeFiSiPsEvMmQiCsYeHlLuHoMgBjFoZkXlObDkSoQcVyReTmRsFzRhTuIvCeBqVsQdQyTyZjStGrTyDcEcAgTgMiIcVkLbZbGvWeHtXwEqWkXfTcPyHhHjYwIeVxLyVmHmMkUsGiHmNnQuMsXaFyPpVqNrBhOiWmNkBbQuHvQdOjPjKiZcL"]],[["aHmRbLgNuWkLxLnWvUbYwTeZeYiOlLhTuOvKfLnVmCiPcMkSgVrYjZiLuRjCiXhAnVzVcTlVeJdBvPdDfFvHkTuIhCdBjEsXbVmGcLrPfNvRdFsZkSdNpYsJeIhIcNqSoLkOjUlYlDmXsOxPbQtIoUxFjGnRtBhFaJvBeEzHsAtVoQbAfYjJqReBiKeUwRqYrUjPjBoHkOkPzDwEwUgTxQxAvKzUpMhKyOhPmEhYhItQwPeKsKaKlUhGuMcTtSwFtXfJsDsFlTtOjVvVfGtBtFlQyIcBaMsPaJlPqUcUvLmReZiFbXxVtRhTzJkLkAjVqTyVuFeKlTyQgUzMsXjOxQnVfTaWmThEnEoIhZeZdStBkKeLpAhJnFoJvQyGwDiStLjEwGfZwBuWsEfC"],["AHmRbLgNuWkLxLnWvUbYwTeZeYiOlLhTuOvKfLnVmCiPcMkSgVrYjZiLuRjCiXhAnVzVcTlVeJdBvPdDfFvHkTuIhCdBjEsXbVmGcLrPfNvRdFsZkSdNpYsJeIhIcNqSoLkOjUlYlDmXsOxPbQtIoUxFjGnRtBhFaJvBeEzHsAtVoQbAfYjJqReBiKeUwRqYrUjPjBoHkOkPzDwEwUgTxQxAvKzUpMhKyOhPmEhYhItQwPeKsKaKlUhGuMcTtSwFtXfJsDsFlTtOjVvVfGtBtFlQyIcBaMsPaJlPqUcUvLmReZiFbXxVtRhTzJkLkAjVqTyVuFeKlTyQgUzMsXjOxQnVfTaWmThEnEoIhZeZdStBkKeLpAhJnFoJvQyGwDiStLjEwGfZwBuWsEfC"]],[["sLlZkDiDmEdNaXuUuJwHqYvRtOdGfTiTpEpAoSqAbJaChOiCvHgSwZwEuPkMmXiLcKdXqSsEyViEbZpZsHeZpTuXoGcRmOiQfBfApPjDqSqElWeSeOhUyWjLyNoRuYeGfGwNqUsQoTyVvWeNgNdZfDxGwGfLsDjIdInSqDlMuNvFaHbScZkTlVwNcJpEjMaPaOtFgJjBjOcLlLmDnQrShIrJhOcUmPnZhTxNeClQsZaEaVaReLyQpLwEqJpUwYhLiRzCzKfOoFeTiXzPiNbOsZaZaLgCiNnMkBcFwGgAwPeNyTxJcCtBgXcToKlWaWcBaIvBpNxPeClQlWeQqRyEtAkJdBtSrFdDvAbUlKyLdCuTtXxFvRcKnYnWzVdYqDeCmOqPxUaFjQdTdCtN"],["SLlZkDiDmEdNaXuUuJwHqYvRtOdGfTiTpEpAoSqAbJaChOiCvHgSwZwEuPkMmXiLcKdXqSsEyViEbZpZsHeZpTuXoGcRmOiQfBfApPjDqSqElWeSeOhUyWjLyNoRuYeGfGwNqUsQoTyVvWeNgNdZfDxGwGfLsDjIdInSqDlMuNvFaHbScZkTlVwNcJpEjMaPaOtFgJjBjOcLlLmDnQrShIrJhOcUmPnZhTxNeClQsZaEaVaReLyQpLwEqJpUwYhLiRzCzKfOoFeTiXzPiNbOsZaZaLgCiNnMkBcFwGgAwPeNyTxJcCtBgXcToKlWaWcBaIvBpNxPeClQlWeQqRyEtAkJdBtSrFdDvAbUlKyLdCuTtXxFvRcKnYnWzVdYqDeCmOqPxUaFjQdTdCtN"]],[["iRuStKvVhJdJbQwRoIuLiVdTpKaOqKfYlYwAzIpPtUwUtMeKyCaOlXmVrKwWeImYmVuXdLkRlHwFxKqZbZtTzNgOzDbGqTfZnKmUzAcIjDcEmQgYyFbEfWzRpKvCkDmAqDiIiRcLvMxWaJqCgYqXgIcLdNaZlBnXtJyKaMnEaWfXfXwTbDnAiYnWqKbAtDpYdUbZrCzWgRnHzYxFgCdDbOkAgTqBuLqMeStHcDxGnVhSgMzVeTaZoTfLjMxQfRuPcFqVlRyYdHyOdJsDoCeWrUuJyIiAqHwHyVpEeEoMaJwAoUfPtBeJqGhMaHiBjKwAlXoZpUsDhHgMxBkVbLcEvNtJbGnPsUwAvXrAkTlXwYvEnOpNeWyIkRnEnTrIyAcLkRgMyYcKrGiDaAyE"],["IRuStKvVhJdJbQwRoIuLiVdTpKaOqKfYlYwAzIpPtUwUtMeKyCaOlXmVrKwWeImYmVuXdLkRlHwFxKqZbZtTzNgOzDbGqTfZnKmUzAcIjDcEmQgYyFbEfWzRpKvCkDmAqDiIiRcLvMxWaJqCgYqXgIcLdNaZlBnXtJyKaMnEaWfXfXwTbDnAiYnWqKbAtDpYdUbZrCzWgRnHzYxFgCdDbOkAgTqBuLqMeStHcDxGnVhSgMzVeTaZoTfLjMxQfRuPcFqVlRyYdHyOdJsDoCeWrUuJyIiAqHwHyVpEeEoMaJwAoUfPtBeJqGhMaHiBjKwAlXoZpUsDhHgMxBkVbLcEvNtJbGnPsUwAvXrAkTlXwYvEnOpNeWyIkRnEnTrIyAcLkRgMyYcKrGiDaAyE"]],[["cRtJkOxHzUbJcDdHzJtLbVmSoWuHoTkVrPqQaVmXeBrHxJbQfNrQbAaMrEhVdQnPxNyCjErKxPoEdWkVrBbDeNmEgBxYiBtWdAfHiLuSwIxJuHpSkAxPoYdNkGoLySsNhUmGoZhDzAfWhJdPlJzQkZbOnMtTkClIoCqOlIcJcMlGjUyOiEmHdYfIcPtTgQhLlLcPqQjAnQnUzHpCaQsCnYgQsBcJrQwBnWsIwFfSfGuYgTzQmShFpKqEeRlRkVfMuZbUsDoFoPrNuNwTtJqFkRiXxPvKyElDzLoUnIwAaBaOiNxMpEvPzSpGpFhMtGhGdJrFnZmNiMcUfMtBnDuUnXqDcMsNyGoLwLeNnLfRsIwRfBtXkHrFcPsLdXaAoYaDzYnZuQeVcZrElWmP"],["CRtJkOxHzUbJcDdHzJtLbVmSoWuHoTkVrPqQaVmXeBrHxJbQfNrQbAaMrEhVdQnPxNyCjErKxPoEdWkVrBbDeNmEgBxYiBtWdAfHiLuSwIxJuHpSkAxPoYdNkGoLySsNhUmGoZhDzAfWhJdPlJzQkZbOnMtTkClIoCqOlIcJcMlGjUyOiEmHdYfIcPtTgQhLlLcPqQjAnQnUzHpCaQsCnYgQsBcJrQwBnWsIwFfSfGuYgTzQmShFpKqEeRlRkVfMuZbUsDoFoPrNuNwTtJqFkRiXxPvKyElDzLoUnIwAaBaOiNxMpEvPzSpGpFhMtGhGdJrFnZmNiMcUfMtBnDuUnXqDcMsNyGoLwLeNnLfRsIwRfBtXkHrFcPsLdXaAoYaDzYnZuQeVcZrElWmP"]],[["wVaCsGxZrBbFnTbKsCoYlAvUkIpBaYpYmJkMlPwCaFvUkDxAiJgIqWsFqZlFvTtAnGzEwXbYiBdFfFxRiDoUkLmRfAwOlKeOlKgXdUnVqLkTuXtNdQpBpXtLvZxWoBeNePyHcWmZyRiUkPlRqYiQdGeXwOhHbCqVjDcEvJmBkRwWnMqPjXpUsIyXqGjHsEsDwZiFpIbTkQaUlUeFxMwJzSaHdHnDhLaLdTuYgFuJsEcMmDvXyPjKsSeBaRwNtPuOuBtNeOhQdVgKzPzOdYtPjPfDzQzHoWcYjFbSvRgGdGsCmGnQsErToBkCwGeQaCbBpYkLhHxTbUvRnJpZtXjKrHdRiUmUbSlJyGaLnWsCrJbBnSjFaZrIzIrThCmGhQcMsTtOxCuUcRaEyPaG"],["WVaCsGxZrBbFnTbKsCoYlAvUkIpBaYpYmJkMlPwCaFvUkDxAiJgIqWsFqZlFvTtAnGzEwXbYiBdFfFxRiDoUkLmRfAwOlKeOlKgXdUnVqLkTuXtNdQpBpXtLvZxWoBeNePyHcWmZyRiUkPlRqYiQdGeXwOhHbCqVjDcEvJmBkRwWnMqPjXpUsIyXqGjHsEsDwZiFpIbTkQaUlUeFxMwJzSaHdHnDhLaLdTuYgFuJsEcMmDvXyPjKsSeBaRwNtPuOuBtNeOhQdVgKzPzOdYtPjPfDzQzHoWcYjFbSvRgGdGsCmGnQsErToBkCwGeQaCbBpYkLhHxTbUvRnJpZtXjKrHdRiUmUbSlJyGaLnWsCrJbBnSjFaZrIzIrThCmGhQcMsTtOxCuUcRaEyPaG"]],[["kEiLxLmPjGzNoGkJdBlAfXhThYhMsHmZoZbGyCvNiUoLoZdAxUbGyQiEfXvPzZzJrPbEcMpHsMjIkRrVvDvQtHuKmXvGpQtXbPzJpFjJdUgWcPdFxLjLtXgVpEiFhImHnKkGiWnZbJqRjCyEwHsNbYfYfTyBaEuKlCtWnOqHmIgGrFmQiYrBnLiFcGuZxXlMfEuVoCxPkVrQvZoIpEhKsYtXrPxLcSfQqXsWaDgVlOnAzUvAhOhMrJfGtWcOwQfRjPmGhDyAeXrNqBvEiDfCiIvWxPjTwPlXpVsMjVjUnCkXgBuWnZaDyJpWkCfBrWnHxMhJgItHdRqNrQaEeRjAuUwRkUdRhEeGlSqVqGmOjNcUhFfXjCmWzBrGvIuZpRyWkWiLyUwFpYjNmNfV"],["KEiLxLmPjGzNoGkJdBlAfXhThYhMsHmZoZbGyCvNiUoLoZdAxUbGyQiEfXvPzZzJrPbEcMpHsMjIkRrVvDvQtHuKmXvGpQtXbPzJpFjJdUgWcPdFxLjLtXgVpEiFhImHnKkGiWnZbJqRjCyEwHsNbYfYfTyBaEuKlCtWnOqHmIgGrFmQiYrBnLiFcGuZxXlMfEuVoCxPkVrQvZoIpEhKsYtXrPxLcSfQqXsWaDgVlOnAzUvAhOhMrJfGtWcOwQfRjPmGhDyAeXrNqBvEiDfCiIvWxPjTwPlXpVsMjVjUnCkXgBuWnZaDyJpWkCfBrWnHxMhJgItHdRqNrQaEeRjAuUwRkUdRhEeGlSqVqGmOjNcUhFfXjCmWzBrGvIuZpRyWkWiLyUwFpYjNmNfV"]],[["eIhDoLmDeReKqXsHcVgFxUqNfScAiQnFrTlCgSuTtXiYvBxKaPaGvUeYfSgHqEaWcHxKpFaSlCxGqAmNeFcIzFcZsBiVoZhUjXaDaIcKoBzYdIlEnKfScRqSkYpPtVsVhXsBwUsUfAqRoCkBxWbHgDiCkRtPvUwVgDjOzObYwNiQwXlGnAqEkHdSqLgUkOdZiWaHqQnOhUnDhIzCiQtVcJlGoRfLuVlFjWqSuMsLgLwOdZvKtWdRuRqDoBoInKqPbJdXpIqLtFlMlDaWgSiKbFpCxOnQeNeQzXeKsBzIjCyPxCmBnYuHzQoYxZgGzSgGtZiTeQmUeWlNzZeKiJbQmEjIiDhPeSyZlNdHpZnIkPdJzSeJpPiXxToKyBjJfPwNzZpWzIzGySqPxLtI"],["EIhDoLmDeReKqXsHcVgFxUqNfScAiQnFrTlCgSuTtXiYvBxKaPaGvUeYfSgHqEaWcHxKpFaSlCxGqAmNeFcIzFcZsBiVoZhUjXaDaIcKoBzYdIlEnKfScRqSkYpPtVsVhXsBwUsUfAqRoCkBxWbHgDiCkRtPvUwVgDjOzObYwNiQwXlGnAqEkHdSqLgUkOdZiWaHqQnOhUnDhIzCiQtVcJlGoRfLuVlFjWqSuMsLgLwOdZvKtWdRuRqDoBoInKqPbJdXpIqLtFlMlDaWgSiKbFpCxOnQeNeQzXeKsBzIjCyPxCmBnYuHzQoYxZgGzSgGtZiTeQmUeWlNzZeKiJbQmEjIiDhPeSyZlNdHpZnIkPdJzSeJpPiXxToKyBjJfPwNzZpWzIzGySqPxLtI"]],[["uOoQzIeTwYeKpJtGoUdNiXbPgEwVsZkAnJcArHxIpEnEhZwQhZvAiOuLeMkVqLeDsAyKeYgFxGmRoLaRsZjAeXgNfYhBkHeDrHdPuTuYhKmDlAvYzYxCdYgYfVaYlGeVqTeSfBxQePbQrKsTaIkGzMjFrQlJuYaMxWpQkLdEcDsIiMnHnDtThRvAcKyGwBsHqKdXpJfIeTeZtYjFbMeUoXoXzGrShTwSwBpQlKeDrZdCjRqNtXoTsIzBkWbMsObTtDvYaPhUeLeHqHeMpZmTaCcIqXzAmGnPfNdDaFhOqWqDrWuFiBpRjZrQmAdViOuMbFfRyXyWfHgRkGpPnDrEqQcEmHcKpEvWlBrOtJbUaXbThJaSxCbVoGvTmHvZrHvXpCvLaYbRiHzYuQyX"],["UOoQzIeTwYeKpJtGoUdNiXbPgEwVsZkAnJcArHxIpEnEhZwQhZvAiOuLeMkVqLeDsAyKeYgFxGmRoLaRsZjAeXgNfYhBkHeDrHdPuTuYhKmDlAvYzYxCdYgYfVaYlGeVqTeSfBxQePbQrKsTaIkGzMjFrQlJuYaMxWpQkLdEcDsIiMnHnDtThRvAcKyGwBsHqKdXpJfIeTeZtYjFbMeUoXoXzGrShTwSwBpQlKeDrZdCjRqNtXoTsIzBkWbMsObTtDvYaPhUeLeHqHeMpZmTaCcIqXzAmGnPfNdDaFhOqWqDrWuFiBpRjZrQmAdViOuMbFfRyXyWfHgRkGpPnDrEqQcEmHcKpEvWlBrOtJbUaXbThJaSxCbVoGvTmHvZrHvXpCvLaYbRiHzYuQyX"]],[["lZqBqKeGvNdSeYuWxRiVnFtYbKuJwQtUcKnVtQhAlOeUzMaAuTaEnDdPfDcNyHgEoBmYjZyFePeJrRiKyAzFnBfAuGiUyLrIeLrNhBeBdVcEeKgCcBrQzDsPwGcNnZvTsEaYmFfMeOmMdNuZbUtDoQoNcGwDqEkEjIdQaPwAxJbXeNxOgKgXoEbZiIsVkRrNpNyAkLeHkNfEpLuQvEcMbIoGaDzXbEtNsLgGfOkZaFiUsOvEjVeCaMcZqMzKeAdXxJsVeCrZaFpJtZxInQxFaSmGgSsVyGeLlFgFqTpIbAvPkIfJrVcJeBxSdEvPyVwIjHpYrLrKqLnAmCuGmPoZrSbOtGaLaTmBmSuUyAmAsRiMqOtRjJhPhAfXaJnTpLbFqPmJgFcBxImTqIiJ"],["LZqBqKeGvNdSeYuWxRiVnFtYbKuJwQtUcKnVtQhAlOeUzMaAuTaEnDdPfDcNyHgEoBmYjZyFePeJrRiKyAzFnBfAuGiUyLrIeLrNhBeBdVcEeKgCcBrQzDsPwGcNnZvTsEaYmFfMeOmMdNuZbUtDoQoNcGwDqEkEjIdQaPwAxJbXeNxOgKgXoEbZiIsVkRrNpNyAkLeHkNfEpLuQvEcMbIoGaDzXbEtNsLgGfOkZaFiUsOvEjVeCaMcZqMzKeAdXxJsVeCrZaFpJtZxInQxFaSmGgSsVyGeLlFgFqTpIbAvPkIfJrVcJeBxSdEvPyVwIjHpYrLrKqLnAmCuGmPoZrSbOtGaLaTmBmSuUyAmAsRiMqOtRjJhPhAfXaJnTpLbFqPmJgFcBxImTqIiJ"]],[["P"],["P"]],[["Xyzzy"],["Xyzzy"]],[["Zzz"],["Zzz"]],[["Zp"],["Zp"]]]}} +{"instance_id":"pseudo_to_code_0.5k_21","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare long long variables n, k and count\nlet bisa be a vector of long longs\ndefine the main function\n read n and k\n for long long i = 1 to square root of n inclusive\n if n % i = 0 && i * i != n\n push i into bisa\n push n \/ i into bisa\n end of the block\n if i * i = n, push i into bisa\n end of the block\n sort bisa\n if n = 1 && k is greater than 1\n print \"-1\"\n else if length of bisa >= k\n print bisa[k - 1]\n else\n print \"-1\"\n end of the block\nend of the block\n\n[CODE]:","reference_output":"long long n, k, count;\nvector bisa;\nint main() {\n cin >> n >> k;\n for (long long i = 1; i <= sqrt(n); i++) {\n if (n % i == 0 && i * i != n) {\n bisa.push_back(i);\n bisa.push_back(n \/ i);\n }\n if (i * i == n) { bisa.push_back(i); }\n }\n sort(bisa.begin(), bisa.end());\n if (n == 1 && k > 1) {\n cout << \"-1\" << endl;\n } else if (bisa.size() >= k) {\n cout << bisa[k - 1] << endl;\n } else {\n cout << \"-1\" << endl;\n }\n}","item":{"problem_id":"762A","pseudocode":"declare long long variables n, k and count\nlet bisa be a vector of long longs\ndefine the main function\n read n and k\n for long long i = 1 to square root of n inclusive\n if n % i = 0 && i * i != n\n push i into bisa\n push n \/ i into bisa\n end of the block\n if i * i = n, push i into bisa\n end of the block\n sort bisa\n if n = 1 && k is greater than 1\n print \"-1\"\n else if length of bisa >= k\n print bisa[k - 1]\n else\n print \"-1\"\n end of the block\nend of the block","testcases":[[["4 2"],["2"]],[["5 3"],["-1"]],[["12 5"],["6"]],[["1 1"],["1"]],[["866421317361600 26880"],["866421317361600"]],[["866421317361600 26881"],["-1"]],[["1000000000000000 1000000000"],["-1"]],[["1000000000000000 100"],["1953125"]],[["1 2"],["-1"]],[["4 3"],["4"]],[["4 4"],["-1"]],[["9 3"],["9"]],[["21 3"],["7"]],[["67280421310721 1"],["1"]],[["6 3"],["3"]],[["3 3"],["-1"]],[["16 3"],["4"]],[["1 1000"],["-1"]],[["16 4"],["8"]],[["36 8"],["18"]],[["49 4"],["-1"]],[["9 4"],["-1"]],[["16 1"],["1"]],[["16 6"],["-1"]],[["16 5"],["16"]],[["25 4"],["-1"]],[["4010815561 2"],["63331"]],[["49 3"],["49"]],[["36 6"],["9"]],[["36 10"],["-1"]],[["25 3"],["25"]],[["22876792454961 28"],["7625597484987"]],[["1234 2"],["2"]],[["179458711 2"],["179458711"]],[["900104343024121 100000"],["-1"]],[["8 3"],["4"]],[["100 6"],["20"]],[["15500 26"],["-1"]],[["111111 1"],["1"]],[["100000000000000 200"],["160000000000"]],[["1000000000000 100"],["6400000"]],[["100 10"],["-1"]],[["1000000000039 2"],["1000000000039"]],[["64 5"],["16"]],[["999999961946176 33"],["63245552"]],[["376219076689 3"],["376219076689"]],[["999999961946176 63"],["999999961946176"]],[["1048576 12"],["2048"]],[["745 21"],["-1"]],[["748 6"],["22"]],[["999999961946176 50"],["161082468097"]],[["10 3"],["5"]],[["1099511627776 22"],["2097152"]],[["1000000007 100010"],["-1"]],[["3 1"],["1"]],[["100 8"],["50"]],[["100 7"],["25"]],[["7 2"],["7"]],[["999999961946176 64"],["-1"]],[["20 5"],["10"]],[["999999999999989 2"],["999999999999989"]],[["100000000000000 114"],["10240000"]],[["99999640000243 3"],["9999991"]],[["999998000001 566"],["333332666667"]],[["99999820000081 2"],["9999991"]],[["49000042000009 3"],["49000042000009"]],[["151491429961 4"],["-1"]],[["32416190071 2"],["32416190071"]],[["1000 8"],["25"]],[["1999967841 15"],["1999967841"]],[["26880 26880"],["-1"]],[["151491429961 3"],["151491429961"]],[["90000000000 300"],["100000000"]],[["98765004361 10"],["-1"]],[["15 2"],["3"]],[["16 2"],["2"]],[["1996 2"],["2"]],[["1997 2"],["1997"]],[["1999 2"],["1999"]],[["1998 2"],["2"]],[["1998 1"],["1"]],[["1998 7"],["27"]],[["1998 8"],["37"]],[["100000380000361 2"],["10000019"]],[["15 1"],["1"]],[["100000000000000 226"],["-1"]],[["844030857550613 517"],["-1"]],[["4567890 14"],["430"]],[["123123123 123123123"],["-1"]],[["24 4"],["4"]],[["999999993568952 17"],["31622777"]],[["99999999994190 9"],["241656799"]],[["999997874844049 4"],["-1"]],[["99999999999931 2"],["99999999999931"]],[["2 3"],["-1"]],[["67280421310721 2"],["67280421310721"]]]}} +{"instance_id":"pseudo_to_code_0.5k_22","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nlet a = array of integers of size 1000010\nlet inf = integer constant with value hexadecimal 3f3f3f3f\ndefine the main function\n let n = integer\n while (read n) is true do the following\n let a, b = arrays of integers of size 310\n read a[0]\n let m = integer of value 0\n for integer i=1 to n exclusive do the following\n read a[i]\n set b[i] = a[i] - a[i-1]\n if b[i] is greater than m set m = b[i]\n end of the block\n let mi = integer with mi = inf\n for integer i=1 to n exclusive do the following\n set b[i] = b[i] + b[i+1]\n if b[i] is less than mi set mi = b[i]\n end of the block\n if mi is greater than m\n print mi\n else\n print m\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int a[1000010];\nconst int inf = 0x3f3f3f3f;\nint main() {\n int n;\n while (cin >> n) {\n int a[310], b[310];\n cin >> a[0];\n int m = 0;\n for (int i = 1; i < n; i++) {\n cin >> a[i];\n b[i] = a[i] - a[i - 1];\n if (b[i] > m) m = b[i];\n }\n int mi = inf;\n for (int i = 1; i < n - 1; i++) {\n b[i] = b[i] + b[i + 1];\n if (b[i] < mi) mi = b[i];\n }\n if (mi > m)\n cout << mi << endl;\n else\n cout << m << endl;\n }\n return 0;\n}","item":{"problem_id":"496A","pseudocode":"let a = array of integers of size 1000010\nlet inf = integer constant with value hexadecimal 3f3f3f3f\ndefine the main function\n let n = integer\n while (read n) is true do the following\n let a, b = arrays of integers of size 310\n read a[0]\n let m = integer of value 0\n for integer i=1 to n exclusive do the following\n read a[i]\n set b[i] = a[i] - a[i-1]\n if b[i] is greater than m set m = b[i]\n end of the block\n let mi = integer with mi = inf\n for integer i=1 to n exclusive do the following\n set b[i] = b[i] + b[i+1]\n if b[i] is less than mi set mi = b[i]\n end of the block\n if mi is greater than m\n print mi\n else\n print m\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["3","1 4 6"],["5"]],[["5","1 2 3 4 5"],["2"]],[["5","1 2 3 7 8"],["4"]],[["3","1 500 1000"],["999"]],[["10","1 2 3 4 5 6 7 8 9 10"],["2"]],[["10","1 4 9 16 25 36 49 64 81 100"],["19"]],[["10","300 315 325 338 350 365 379 391 404 416"],["23"]],[["15","87 89 91 92 93 95 97 99 101 103 105 107 109 111 112"],["2"]],[["60","3 5 7 8 15 16 18 21 24 26 40 41 43 47 48 49 50 51 52 54 55 60 62 71 74 84 85 89 91 96 406 407 409 412 417 420 423 424 428 431 432 433 436 441 445 446 447 455 458 467 469 471 472 475 480 485 492 493 497 500"],["310"]],[["3","159 282 405"],["246"]],[["81","6 7 22 23 27 38 40 56 59 71 72 78 80 83 86 92 95 96 101 122 125 127 130 134 154 169 170 171 172 174 177 182 184 187 195 197 210 211 217 223 241 249 252 253 256 261 265 269 274 277 291 292 297 298 299 300 302 318 338 348 351 353 381 386 387 397 409 410 419 420 428 430 453 460 461 473 478 493 494 500 741"],["241"]],[["10","218 300 388 448 535 629 680 740 836 925"],["111"]],[["100","6 16 26 36 46 56 66 76 86 96 106 116 126 136 146 156 166 176 186 196 206 216 226 236 246 256 266 276 286 296 306 316 326 336 346 356 366 376 386 396 406 416 426 436 446 456 466 476 486 496 506 516 526 536 546 556 566 576 586 596 606 616 626 636 646 656 666 676 686 696 706 716 726 736 746 756 766 776 786 796 806 816 826 836 846 856 866 876 886 896 906 916 926 936 946 956 966 976 986 996"],["20"]],[["100","1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000"],["901"]],[["100","1 9 15 17 28 29 30 31 32 46 48 49 52 56 62 77 82 85 90 91 94 101 102 109 111 113 116 118 124 125 131 132 136 138 139 143 145 158 161 162 165 167 171 173 175 177 179 183 189 196 801 802 804 806 817 819 827 830 837 840 842 846 850 855 858 862 863 866 869 870 878 881 883 884 896 898 899 901 904 906 908 909 910 911 912 917 923 924 925 935 939 943 945 956 963 964 965 972 976 978"],["605"]],[["100","2 43 47 49 50 57 59 67 74 98 901 903 904 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 938 939 940 942 943 944 945 946 947 948 949 950 952 953 954 956 957 958 959 960 961 962 963 965 966 967 968 969 970 971 972 973 974 975 976 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 998 999"],["803"]],[["72","178 186 196 209 217 226 236 248 260 273 281 291 300 309 322 331 343 357 366 377 389 399 409 419 429 442 450 459 469 477 491 501 512 524 534 548 557 568 582 593 602 616 630 643 652 660 670 679 693 707 715 728 737 750 759 768 776 789 797 807 815 827 837 849 863 873 881 890 901 910 920 932"],["17"]],[["38","1 28 55 82 109 136 163 190 217 244 271 298 325 352 379 406 433 460 487 514 541 568 595 622 649 676 703 730 757 784 811 838 865 892 919 946 973 1000"],["54"]],[["28","1 38 75 112 149 186 223 260 297 334 371 408 445 482 519 556 593 630 667 704 741 778 815 852 889 926 963 1000"],["74"]]]}} +{"instance_id":"pseudo_to_code_0.5k_23","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let n, t, k, d be integers\n read n, t, k, d\n let k1, t1, i be integers with k1 = 0, t1 = t, i = -1\n increment d by t\n if k >= n\n print NO and newline\n return to indicate successful execution\n end of the block\n let counter be a integer with counter = ceiling ((float)n \/ k) * t\n while k1 is less than n\n if i is equal to t1\n increment k1 by k\n increment t1 by t\n end of the block\n if i is equal to d\n increment k1 by k\n increment d by t\n end of the block\n if k1 is less than n, increment i by 1\n end of the block\n if i is less than counter\n print YES and newline\n else do the following\n print NO and newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, t, k, d;\n cin >> n >> t >> k >> d;\n int k1 = 0, t1 = t, i = -1;\n d += t;\n if (k >= n) {\n cout << \"NO\" << endl;\n return 0;\n }\n int counter = ceil((float)n \/ k) * t;\n while (k1 < n) {\n if (i == t1) {\n k1 += k;\n t1 += t;\n }\n if (i == d) {\n k1 += k;\n d += t;\n }\n if (k1 < n) ++i;\n }\n if (i < counter)\n cout << \"YES\" << endl;\n else\n cout << \"NO\" << endl;\n return 0;\n}","item":{"problem_id":"799A","pseudocode":"define the main function\n let n, t, k, d be integers\n read n, t, k, d\n let k1, t1, i be integers with k1 = 0, t1 = t, i = -1\n increment d by t\n if k >= n\n print NO and newline\n return to indicate successful execution\n end of the block\n let counter be a integer with counter = ceiling ((float)n \/ k) * t\n while k1 is less than n\n if i is equal to t1\n increment k1 by k\n increment t1 by t\n end of the block\n if i is equal to d\n increment k1 by k\n increment d by t\n end of the block\n if k1 is less than n, increment i by 1\n end of the block\n if i is less than counter\n print YES and newline\n else do the following\n print NO and newline\n return to indicate successful execution\nend of the block","testcases":[[["8 6 4 5"],["YES"]],[["8 6 4 6"],["NO"]],[["10 3 11 4"],["NO"]],[["4 2 1 4"],["YES"]],[["28 17 16 26"],["NO"]],[["60 69 9 438"],["NO"]],[["599 97 54 992"],["YES"]],[["11 22 18 17"],["NO"]],[["1 13 22 11"],["NO"]],[["1 1 1 1"],["NO"]],[["3 1 1 1"],["YES"]],[["1000 1000 1000 1000"],["NO"]],[["1000 1000 1 1"],["YES"]],[["1000 1000 1 400"],["YES"]],[["1000 1000 1 1000"],["YES"]],[["1000 1000 1 999"],["YES"]],[["53 11 3 166"],["YES"]],[["313 2 3 385"],["NO"]],[["214 9 9 412"],["NO"]],[["349 9 5 268"],["YES"]],[["611 16 8 153"],["YES"]],[["877 13 3 191"],["YES"]],[["340 9 9 10"],["YES"]],[["31 8 2 205"],["NO"]],[["519 3 2 148"],["YES"]],[["882 2 21 219"],["NO"]],[["982 13 5 198"],["YES"]],[["428 13 6 272"],["YES"]],[["436 16 14 26"],["YES"]],[["628 10 9 386"],["YES"]],[["77 33 18 31"],["YES"]],[["527 36 4 8"],["YES"]],[["128 18 2 169"],["YES"]],[["904 4 2 288"],["YES"]],[["986 4 3 25"],["YES"]],[["134 8 22 162"],["NO"]],[["942 42 3 69"],["YES"]],[["894 4 9 4"],["YES"]],[["953 8 10 312"],["YES"]],[["43 8 1 121"],["YES"]],[["12 13 19 273"],["NO"]],[["204 45 10 871"],["YES"]],[["342 69 50 425"],["NO"]],[["982 93 99 875"],["NO"]],[["283 21 39 132"],["YES"]],[["1000 45 83 686"],["NO"]],[["246 69 36 432"],["NO"]],[["607 93 76 689"],["NO"]],[["503 21 24 435"],["NO"]],[["1000 45 65 989"],["NO"]],[["30 21 2 250"],["YES"]],[["1000 49 50 995"],["NO"]],[["383 69 95 253"],["YES"]],[["393 98 35 999"],["YES"]],[["1000 22 79 552"],["NO"]],[["268 294 268 154"],["NO"]],[["963 465 706 146"],["YES"]],[["304 635 304 257"],["NO"]],[["4 2 1 6"],["NO"]],[["1 51 10 50"],["NO"]],[["5 5 4 4"],["YES"]],[["3 2 1 1"],["YES"]],[["3 4 3 3"],["NO"]],[["7 3 4 1"],["YES"]],[["101 10 1 1000"],["NO"]],[["5 1 1 1"],["YES"]],[["5 10 5 5"],["NO"]],[["19 1 7 1"],["YES"]],[["763 572 745 262"],["YES"]],[["1 2 1 1"],["NO"]],[["5 1 1 3"],["YES"]],[["170 725 479 359"],["NO"]],[["6 2 1 7"],["YES"]],[["6 2 5 1"],["YES"]],[["1 2 2 1"],["NO"]],[["24 2 8 3"],["YES"]],[["7 3 3 3"],["YES"]],[["5 2 2 2"],["YES"]],[["3 2 1 2"],["YES"]],[["1000 2 200 8"],["NO"]],[["3 100 2 100"],["NO"]],[["2 999 1 1000"],["NO"]],[["2 1 1 1"],["NO"]],[["2 3 5 1"],["NO"]],[["100 1 5 1"],["YES"]],[["7 2 3 3"],["YES"]],[["4 1 1 3"],["NO"]],[["3 2 2 1"],["YES"]],[["1 1 1 2"],["NO"]],[["91 8 7 13"],["YES"]],[["3 1 2 1"],["NO"]],[["5 3 2 3"],["YES"]],[["9 6 6 3"],["YES"]]]}} +{"instance_id":"pseudo_to_code_0.5k_24","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare long longs a, b\n input a and b\n if a is positive\n if b is positive\n display 0, ' ', a + b, ' '. a + b, ' ', 0\n else\n display 0, ' ', b - a, ' ', a - b, ' ', 0\n else\n if b is positive\n display a - b, ' ', 0, ' ', 0, ' ', b - a\n else\n display a + b, ' ', 0, ' ', 0, ' ', a + b\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long a, b;\n cin >> a >> b;\n if (a > 0) {\n if (b > 0)\n cout << 0 << ' ' << a + b << ' ' << a + b << ' ' << 0 << '\\n';\n else\n cout << 0 << ' ' << b - a << ' ' << a - b << ' ' << 0 << '\\n';\n } else {\n if (b > 0)\n cout << a - b << ' ' << 0 << ' ' << 0 << ' ' << b - a << '\\n';\n else\n cout << a + b << ' ' << 0 << ' ' << 0 << ' ' << a + b << '\\n';\n }\n return 0;\n}","item":{"problem_id":"336A","pseudocode":"define the main function\n declare long longs a, b\n input a and b\n if a is positive\n if b is positive\n display 0, ' ', a + b, ' '. a + b, ' ', 0\n else\n display 0, ' ', b - a, ' ', a - b, ' ', 0\n else\n if b is positive\n display a - b, ' ', 0, ' ', 0, ' ', b - a\n else\n display a + b, ' ', 0, ' ', 0, ' ', a + b\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["10 5"],["0 15 15 0"]],[["-10 5"],["-15 0 0 15"]],[["20 -10"],["0 -30 30 0"]],[["-10 -1000000000"],["-1000000010 0 0 -1000000010"]],[["-1000000000 -1000000000"],["-2000000000 0 0 -2000000000"]],[["1000000000 1000000000"],["0 2000000000 2000000000 0"]],[["-123131 3123141"],["-3246272 0 0 3246272"]],[["-23423 -243242423"],["-243265846 0 0 -243265846"]],[["123112 4560954"],["0 4684066 4684066 0"]],[["1321 -23131"],["0 -24452 24452 0"]],[["1000000000 999999999"],["0 1999999999 1999999999 0"]],[["54543 432423"],["0 486966 486966 0"]],[["1 1"],["0 2 2 0"]],[["-1 -1"],["-2 0 0 -2"]],[["-1 1"],["-2 0 0 2"]],[["1 -1"],["0 -2 2 0"]],[["42 -2"],["0 -44 44 0"]],[["2 -435"],["0 -437 437 0"]],[["76 -76"],["0 -152 152 0"]],[["1000000000 1"],["0 1000000001 1000000001 0"]],[["1000000000 -1"],["0 -1000000001 1000000001 0"]],[["-1000000000 1"],["-1000000001 0 0 1000000001"]],[["-1000000000 -1"],["-1000000001 0 0 -1000000001"]],[["1000000000 -999999999"],["0 -1999999999 1999999999 0"]],[["-1000000000 999999999"],["-1999999999 0 0 1999999999"]],[["-1000000000 -999999999"],["-1999999999 0 0 -1999999999"]],[["999999999 1000000000"],["0 1999999999 1999999999 0"]],[["-999999999 1000000000"],["-1999999999 0 0 1999999999"]],[["999999999 -1000000000"],["0 -1999999999 1999999999 0"]],[["-999999999 -1000000000"],["-1999999999 0 0 -1999999999"]]]}} +{"instance_id":"pseudo_to_code_0.5k_25","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare my_gcd taking in ints x and y and returning integer\n if x is 0, return y\n return the return value of my_gcd(y % x, x)\nend of the block\ndefine the main function\n create ints n, m, and z\n read n, m, and z\n create integer lcm = n * m \/ my_gcd(n, m)\n print z \/ lcm\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int my_gcd(int x, int y) {\n if (x == 0) { return y; }\n return my_gcd(y % x, x);\n}\nint main() {\n int n, m, z;\n cin >> n >> m >> z;\n int lcm = n * m \/ my_gcd(n, m);\n cout << z \/ lcm << endl;\n return 0;\n}","item":{"problem_id":"764A","pseudocode":"declare my_gcd taking in ints x and y and returning integer\n if x is 0, return y\n return the return value of my_gcd(y % x, x)\nend of the block\ndefine the main function\n create ints n, m, and z\n read n, m, and z\n create integer lcm = n * m \/ my_gcd(n, m)\n print z \/ lcm\n return to indicate successful execution\nend of the block","testcases":[[["1 1 10"],["10"]],[["1 2 5"],["2"]],[["2 3 9"],["1"]],[["4 8 9"],["1"]],[["7 9 2"],["0"]],[["10000 10000 10000"],["1"]],[["24 22 9235"],["34"]],[["74 8 417"],["1"]],[["972 1 203"],["0"]],[["550 1 754"],["1"]],[["860 1 884"],["1"]],[["358 2 809"],["2"]],[["33 27 216"],["0"]],[["2940 1 9311"],["3"]],[["4624 1 1953"],["0"]],[["2696 2 7345"],["2"]],[["3443 2 6701"],["0"]],[["3 613 2275"],["1"]],[["1 10000 10000"],["1"]],[["10000 1 10000"],["1"]],[["1 1 1"],["1"]],[["1 1 10000"],["10000"]],[["34 27 10000"],["10"]],[["2 2 9999"],["4999"]],[["2 2 1"],["0"]],[["6 4 36"],["3"]],[["33 6 3005"],["45"]],[["5 1 20"],["4"]],[["1 2 10"],["5"]],[["2 1 100"],["50"]],[["10 20 10000"],["500"]],[["8 12 12"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_26","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate integers k, n, x, a, ans\ndefine the main function\n read k read n read x\n for i = 0 to k exclusive\n read a\n if k - n is less than or equal to i and a is greater than x\n increment ans by x\n else\n increment ans by a\n end of the block\n print ans print '\\n'\nend of the block\n\n[CODE]:","reference_output":"int k, n, x, a, ans;\nint main() {\n cin >> k >> n >> x;\n for (int i = 0; i < k; i++) {\n cin >> a;\n if (k - n <= i && a > x)\n ans += x;\n else\n ans += a;\n }\n cout << ans << '\\n';\n}","item":{"problem_id":"873A","pseudocode":"create integers k, n, x, a, ans\ndefine the main function\n read k read n read x\n for i = 0 to k exclusive\n read a\n if k - n is less than or equal to i and a is greater than x\n increment ans by x\n else\n increment ans by a\n end of the block\n print ans print '\\n'\nend of the block","testcases":[[["4 2 2","3 6 7 10"],["13"]],[["5 2 1","100 100 100 100 100"],["302"]],[["1 1 1","100"],["1"]],[["100 1 99","100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100"],["9999"]],[["100 100 1","100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100"],["100"]],[["100 50 50","51 51 52 53 55 55 55 55 56 56 56 57 57 58 58 59 59 59 60 60 61 61 62 62 63 64 64 64 64 65 65 65 65 66 66 66 67 68 68 68 69 69 70 70 70 70 71 71 71 71 71 71 72 72 76 76 76 76 77 79 79 81 81 81 81 82 82 82 82 83 84 85 86 87 87 88 88 88 89 89 89 90 90 90 91 91 91 92 92 93 95 95 96 96 96 97 97 98 99 100"],["5618"]],[["100 100 1","2 4 4 4 5 5 5 6 10 10 11 11 12 12 13 13 13 14 17 18 20 20 21 21 22 22 23 24 24 25 26 29 29 32 32 34 34 35 38 39 39 40 40 42 42 43 45 47 48 49 51 52 52 54 57 59 59 60 61 61 62 63 63 64 65 65 68 70 70 72 74 75 75 76 76 77 77 78 78 78 79 80 81 82 82 83 83 83 84 89 90 92 92 93 94 96 96 97 98 99"],["100"]],[["100 1 1","3 3 5 7 8 8 8 9 9 9 11 13 14 15 18 18 19 20 21 22 22 25 27 27 29 31 32 33 33 34 36 37 37 38 40 42 44 44 46 47 47 48 48 48 50 50 51 51 54 54 54 55 55 56 56 56 60 61 62 62 63 64 65 65 68 70 70 71 71 71 71 75 75 76 76 79 79 79 79 81 81 82 82 86 86 86 86 88 90 90 92 96 97 97 98 98 98 98 100 100"],["5202"]],[["100 50 49","50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51"],["4950"]],[["100 50 1","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3"],["151"]],[["100 1 1","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2"],["199"]]]}} +{"instance_id":"pseudo_to_code_0.5k_27","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare long long variables n, t, e, f, g and y\ncreate new 2d array of long longs Ta 5001 by 4, filled with 0\ndefine the main function\n read from the input to n\n for x from 1 to n inclusive, incrementing x\n read t from the user input\n if t is equal to 1\n set the value of Ta[x - f - g][1] to x\n increment e by one\n else if t is equal to 2\n change the value of Ta[x - e - g][2] to x\n increment f\n else if t is equal to 3\n change Ta[x - e - f][3] to x\n increment g\n end of the block\n end of the block\n for x = 1 to n inclusive incrementing x\n if none of Ta[x][1, Ta[x][2] and Ta[x][3] is equal to 0, increment y\n end of the block\n if y = 0\n print \"0\" to the standard output\n else\n print y to the standard output\n for x = 1 to y inclusive, print Ta[x][1], \" \", Ta[x][2], \" \" and Ta[x][3]\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"long long n, t, e, f, g, y;\nlong long Ta[5001][4] = {0, 0};\nint main() {\n cin >> n;\n for (int x = 1; x <= n; x++) {\n cin >> t;\n if (t == 1) {\n Ta[x - f - g][1] = x;\n e++;\n } else if (t == 2) {\n Ta[x - e - g][2] = x;\n f++;\n } else if (t == 3) {\n Ta[x - e - f][3] = x;\n g++;\n }\n }\n for (int x = 1; x <= n; x++) {\n if (Ta[x][1] != 0 && Ta[x][2] != 0 && Ta[x][3] != 0) { y++; }\n }\n if (y == 0) {\n cout << \"0\" << endl;\n } else {\n cout << y << endl;\n for (int x = 1; x <= y; x++) { cout << Ta[x][1] << \" \" << Ta[x][2] << \" \" << Ta[x][3] << endl; }\n }\n return 0;\n}","item":{"problem_id":"490A","pseudocode":"declare long long variables n, t, e, f, g and y\ncreate new 2d array of long longs Ta 5001 by 4, filled with 0\ndefine the main function\n read from the input to n\n for x from 1 to n inclusive, incrementing x\n read t from the user input\n if t is equal to 1\n set the value of Ta[x - f - g][1] to x\n increment e by one\n else if t is equal to 2\n change the value of Ta[x - e - g][2] to x\n increment f\n else if t is equal to 3\n change Ta[x - e - f][3] to x\n increment g\n end of the block\n end of the block\n for x = 1 to n inclusive incrementing x\n if none of Ta[x][1, Ta[x][2] and Ta[x][3] is equal to 0, increment y\n end of the block\n if y = 0\n print \"0\" to the standard output\n else\n print y to the standard output\n for x = 1 to y inclusive, print Ta[x][1], \" \", Ta[x][2], \" \" and Ta[x][3]\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["7","1 3 1 3 2 1 2"],["2","1 5 2","3 7 4"]],[["4","2 1 1 2"],["0"]],[["1","2"],["0"]],[["2","3 1"],["0"]],[["3","2 1 2"],["0"]],[["3","1 2 3"],["1","1 2 3"]],[["12","3 3 3 3 3 3 3 3 1 3 3 2"],["1","9 12 1"]],[["60","3 3 1 2 2 1 3 1 1 1 3 2 2 2 3 3 1 3 2 3 2 2 1 3 3 2 3 1 2 2 2 1 3 2 1 1 3 3 1 1 1 3 1 2 1 1 3 3 3 2 3 2 3 2 2 2 1 1 1 2"],["20","3 4 1","6 5 2","8 12 7","9 13 11","10 14 15","17 19 16","23 21 18","28 22 20","32 26 24","35 29 25","36 30 27","39 31 33","40 34 37","41 44 38","43 50 42","45 52 47","46 54 48","57 55 49","58 56 51","59 60 53"]],[["12","3 1 1 1 1 1 1 2 1 1 1 1"],["1","2 8 1"]],[["22","2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 1 2 2 2 2"],["1","18 1 11"]],[["138","2 3 2 2 2 2 2 2 2 2 1 2 1 2 2 2 1 2 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 1 2 3 2 2 2 1 2 3 2 2 2 3 1 3 2 3 2 3 2 2 2 2 3 2 2 2 2 2 1 2 2 3 2 2 3 2 1 2 2 2 2 2 3 1 2 2 2 2 2 3 2 2 3 2 2 2 2 2 1 1 2 3 2 2 2 2 3 2 2 2 2 2 1 2 1 2 2 2 2 2 1 2 3 2 3 2 2 2 1 2 2 2 1 2 2 2 2 1 2 2 2 2 1 3"],["18","11 1 2","13 3 36","17 4 42","19 5 46","22 6 48","34 7 50","40 8 52","47 9 57","63 10 66","71 12 69","78 14 77","93 15 84","94 16 87","107 18 96","109 20 101","115 21 117","123 23 119","127 24 138"]],[["203","2 2 1 2 1 2 2 2 1 2 2 1 1 3 1 2 1 2 1 1 2 3 1 1 2 3 3 2 2 2 1 2 1 1 1 1 1 3 1 1 2 1 1 2 2 2 1 2 2 2 1 2 3 2 1 1 2 2 1 2 1 2 2 1 1 2 2 2 1 1 2 2 1 2 1 2 2 3 2 1 2 1 1 1 1 1 1 1 1 1 1 2 2 1 1 2 2 2 2 1 1 1 1 1 1 1 2 2 2 2 2 1 1 1 2 2 2 1 2 2 1 3 2 1 1 1 2 1 1 2 1 1 2 2 2 1 1 2 2 2 1 2 1 3 2 1 2 2 2 1 1 1 2 2 2 1 2 1 1 2 2 2 2 2 1 1 2 1 2 2 1 1 1 1 1 1 2 2 3 1 1 2 3 1 1 1 1 1 1 2 2 1 1 1 2 2 3 2 1 3 1 1 1"],["13","3 1 14","5 2 22","9 4 26","12 6 27","13 7 38","15 8 53","17 10 78","19 11 122","20 16 144","23 18 179","24 21 183","31 25 197","33 28 200"]],[["220","1 1 3 1 3 1 1 3 1 3 3 3 3 1 3 3 1 3 3 3 3 3 1 1 1 3 1 1 1 3 2 3 3 3 1 1 3 3 1 1 3 3 3 3 1 3 3 1 1 1 2 3 1 1 1 2 3 3 3 2 3 1 1 3 1 1 1 3 2 1 3 2 3 1 1 3 3 3 1 3 1 1 1 3 3 2 1 3 2 1 1 3 3 1 1 1 2 1 1 3 2 1 2 1 1 1 3 1 3 3 1 2 3 3 3 3 1 3 1 1 1 1 2 3 1 1 1 1 1 1 3 2 3 1 3 1 3 1 1 3 1 3 1 3 1 3 1 3 3 2 3 1 3 3 1 3 3 3 3 1 1 3 3 3 3 1 1 3 3 3 2 1 1 1 3 3 1 3 3 3 1 1 1 3 1 3 3 1 1 1 2 3 1 1 3 1 1 1 1 2 3 1 1 2 3 3 1 3 1 3 3 3 3 1 3 2 3 1 1 3"],["20","1 31 3","2 51 5","4 56 8","6 60 10","7 69 11","9 72 12","14 86 13","17 89 15","23 97 16","24 101 18","25 103 19","27 112 20","28 123 21","29 132 22","35 150 26","36 171 30","39 191 32","40 200 33","45 204 34","48 216 37"]],[["61","2 3 1 3 2 2 2 3 1 3 2 3 1 2 1 1 2 2 2 2 3 2 3 1 2 1 3 1 3 2 1 1 3 2 1 3 3 3 1 3 3 1 1 3 1 3 2 2 1 2 2 2 1 3 2 3 1 3 3 1 1"],["20","3 1 2","9 5 4","13 6 8","15 7 10","16 11 12","24 14 21","26 17 23","28 18 27","31 19 29","32 20 33","35 22 36","39 25 37","42 30 38","43 34 40","45 47 41","49 48 44","53 50 46","57 51 54","60 52 56","61 55 58"]],[["5","1 2 2 3 3"],["1","1 2 4"]]]}} +{"instance_id":"pseudo_to_code_0.5k_28","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare new constant integer MAX_N with value 1000 + 10\ndeclare 3d array of integers a with size MAX_N by 2 by 2, and b with size 4 by 2 by 2\ncheck is a new array of booleans with MAX_N elements\nboolean function hast with int arguments i and s\n change the value of b[0][0][0] to a[i][0][0]\n assign a[i][0][1] to b[0][0][1]\n change b[0][1][0] to a[i][1][0]\n set the value of b[0][1][1] to a[i][1][1]\n set the value of b[1][0][0] to a[i][1][0]\n assign the new value = a[i][0][0] to b[1][0][1]\n assign the new value = a[i][1][1] to b[1][1][0]\n change the value of b[1][1][1] to a[i][0][1]\n change b[2][0][0] to a[i][1][1]\n set b[2][0][1] to a[i][1][0]\n change the value of b[2][1][0] to a[i][0][1]\n change the value of b[2][1][1] to a[i][0][0]\n change b[3][0][0] to a[i][0][1]\n change the value of b[3][0][1] to a[i][1][1]\n assign the new value = a[i][0][0] to b[3][1][0]\n set b[3][1][1] to a[i][1][0]\n start for loop from i = 0 to 4 exclusive\n declare integer variable x with value 0\n start for loop from j = 0 to 2 exclusive incrementing j\n start for loop from t = 0 to 2 exclusive\n increment x if b[i][j][t] = a[s][j][t]\n if x is equal to 4, return true\n end of the block\n return false\nend of the block\ndefine the main function\n define integers n, aa, bb and ans where ans = 0\n create new string called s\n read variable n from the input\n for i from 0 to n exclusive\n read standard input to aa and bb\n if i is less than n - 1, read s\n set a[i][0][0] to aa \/ 10\n assign aa modulo 10 to a[i][0][1]\n set the value of a[i][1][0] to bb \/ 10\n set the value of a[i][1][1] to bb modulo 10\n end of the block\n start for loop from i = 0 to n exclusive incrementing i\n if check[i] is true, skip the rest of the loop\n in a for loop, change j from i+1 to n exclusive\n if hast(i, j) returned true, change the value of check[j] to true\n end of the block\n for i from 0 to n exclusive\n if check[i] is false, increment ans\n print ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int MAX_N = 1000 + 10;\nint a[MAX_N][2][2], b[4][2][2];\nbool check[MAX_N];\nbool hast(int i, int s) {\n b[0][0][0] = a[i][0][0];\n b[0][0][1] = a[i][0][1];\n b[0][1][0] = a[i][1][0];\n b[0][1][1] = a[i][1][1];\n b[1][0][0] = a[i][1][0];\n b[1][0][1] = a[i][0][0];\n b[1][1][0] = a[i][1][1];\n b[1][1][1] = a[i][0][1];\n b[2][0][0] = a[i][1][1];\n b[2][0][1] = a[i][1][0];\n b[2][1][0] = a[i][0][1];\n b[2][1][1] = a[i][0][0];\n b[3][0][0] = a[i][0][1];\n b[3][0][1] = a[i][1][1];\n b[3][1][0] = a[i][0][0];\n b[3][1][1] = a[i][1][0];\n for (int i = 0; i < 4; i++) {\n int x = 0;\n for (int j = 0; j < 2; j++)\n for (int t = 0; t < 2; t++)\n if (b[i][j][t] == a[s][j][t]) x++;\n if (x == 4) return true;\n }\n return false;\n}\nint main() {\n int n, aa, bb, ans = 0;\n string s;\n cin >> n;\n for (int i = 0; i < n; i++) {\n cin >> aa >> bb;\n if (i < n - 1) cin >> s;\n a[i][0][0] = aa \/ 10;\n a[i][0][1] = aa % 10;\n a[i][1][0] = bb \/ 10;\n a[i][1][1] = bb % 10;\n }\n for (int i = 0; i < n; i++) {\n if (check[i] == true) continue;\n for (int j = i + 1; j < n; j++)\n if (hast(i, j) == true) check[j] = true;\n }\n for (int i = 0; i < n; i++)\n if (check[i] == false) ans++;\n cout << ans << endl;\n return 0;\n}","item":{"problem_id":"51A","pseudocode":"declare new constant integer MAX_N with value 1000 + 10\ndeclare 3d array of integers a with size MAX_N by 2 by 2, and b with size 4 by 2 by 2\ncheck is a new array of booleans with MAX_N elements\nboolean function hast with int arguments i and s\n change the value of b[0][0][0] to a[i][0][0]\n assign a[i][0][1] to b[0][0][1]\n change b[0][1][0] to a[i][1][0]\n set the value of b[0][1][1] to a[i][1][1]\n set the value of b[1][0][0] to a[i][1][0]\n assign the new value = a[i][0][0] to b[1][0][1]\n assign the new value = a[i][1][1] to b[1][1][0]\n change the value of b[1][1][1] to a[i][0][1]\n change b[2][0][0] to a[i][1][1]\n set b[2][0][1] to a[i][1][0]\n change the value of b[2][1][0] to a[i][0][1]\n change the value of b[2][1][1] to a[i][0][0]\n change b[3][0][0] to a[i][0][1]\n change the value of b[3][0][1] to a[i][1][1]\n assign the new value = a[i][0][0] to b[3][1][0]\n set b[3][1][1] to a[i][1][0]\n start for loop from i = 0 to 4 exclusive\n declare integer variable x with value 0\n start for loop from j = 0 to 2 exclusive incrementing j\n start for loop from t = 0 to 2 exclusive\n increment x if b[i][j][t] = a[s][j][t]\n if x is equal to 4, return true\n end of the block\n return false\nend of the block\ndefine the main function\n define integers n, aa, bb and ans where ans = 0\n create new string called s\n read variable n from the input\n for i from 0 to n exclusive\n read standard input to aa and bb\n if i is less than n - 1, read s\n set a[i][0][0] to aa \/ 10\n assign aa modulo 10 to a[i][0][1]\n set the value of a[i][1][0] to bb \/ 10\n set the value of a[i][1][1] to bb modulo 10\n end of the block\n start for loop from i = 0 to n exclusive incrementing i\n if check[i] is true, skip the rest of the loop\n in a for loop, change j from i+1 to n exclusive\n if hast(i, j) returned true, change the value of check[j] to true\n end of the block\n for i from 0 to n exclusive\n if check[i] is false, increment ans\n print ans\n return to indicate successful execution\nend of the block","testcases":[[["4","31","23","**","31","23","**","13","32","**","32","13"],["1"]],[["4","51","26","**","54","35","**","25","61","**","45","53"],["2"]],[["4","56","61","**","31","31","**","33","11","**","11","33"],["2"]],[["4","36","44","**","32","46","**","66","41","**","64","34"],["3"]],[["3","63","63","**","66","33","**","36","36"],["1"]],[["3","11","54","**","42","63","**","42","63"],["2"]],[["3","14","54","**","45","41","**","12","22"],["2"]],[["7","21","33","**","33","12","**","32","31","**","21","33","**","33","12","**","32","31","**","13","23"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_29","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ngcd is a int function with int arguments a and b\n return a if b = 0, or gcd of b and a % b otherwise\nend of the block\ndefine the main function\n declare ints a, b, n, k and c with k = 0 and c = 2\n read a, b and n\n while n > 0\n if c is even\n set n to n - gcd of a and n\n change k to 0\n assign 1 to c\n else\n change n to n - gcd of b and n\n set k to 1\n change c to 2\n end of the block\n end of the block\n print k\nend of the block\n\n[CODE]:","reference_output":"int gcd(int a, int b) {\n return b == 0 ? a : gcd(b, a % b);\n}\nint main() {\n int a, b, n, k = 0, c = 2;\n cin >> a >> b >> n;\n while (n > 0) {\n if (c % 2 == 0) {\n n = n - gcd(a, n);\n k = 0;\n c = 1;\n } else {\n n = n - gcd(b, n);\n k = 1;\n c = 2;\n }\n }\n cout << k << endl;\n}","item":{"problem_id":"119A","pseudocode":"gcd is a int function with int arguments a and b\n return a if b = 0, or gcd of b and a % b otherwise\nend of the block\ndefine the main function\n declare ints a, b, n, k and c with k = 0 and c = 2\n read a, b and n\n while n > 0\n if c is even\n set n to n - gcd of a and n\n change k to 0\n assign 1 to c\n else\n change n to n - gcd of b and n\n set k to 1\n change c to 2\n end of the block\n end of the block\n print k\nend of the block","testcases":[[["3 5 9"],["0"]],[["1 1 100"],["1"]],[["23 12 16"],["1"]],[["95 26 29"],["1"]],[["73 32 99"],["1"]],[["1 1 1"],["0"]],[["41 12 65"],["1"]],[["13 61 100"],["1"]],[["100 100 10"],["0"]],[["12 24 26"],["1"]],[["73 21 96"],["1"]],[["17 22 81"],["1"]],[["14 88 97"],["1"]],[["42 81 17"],["0"]],[["34 36 19"],["1"]],[["21 87 12"],["1"]],[["97 92 98"],["1"]],[["49 25 62"],["1"]],[["29 17 44"],["1"]],[["10 1 10"],["0"]],[["99 98 100"],["1"]],[["100 100 1"],["0"]],[["11 99 55"],["0"]],[["8 13 21"],["0"]],[["34 55 89"],["0"]],[["21 34 55"],["1"]],[["13 21 34"],["1"]],[["34 21 55"],["0"]],[["10 20 84"],["1"]],[["4 2 5"],["0"]],[["3 2 3"],["0"]],[["31 23 1"],["0"]],[["100 100 100"],["0"]],[["100 1 100"],["0"]],[["1 100 100"],["1"]],[["1 1 100"],["1"]],[["17 23 100"],["1"]],[["99 98 100"],["1"]],[["1 1 2"],["1"]],[["2 1 1"],["0"]],[["1 2 1"],["0"]],[["2 1 2"],["0"]],[["10 10 3"],["1"]],[["2 2 1"],["0"]],[["9 5 1"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_30","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate integer 2d array ch with 2000 by 2 elements\ndefine the main function\n create integer n\n read n\n declare integer now = 1\n for integer i = 1 to n inclusive, read ch[i][0] and ch[i][1]\n for i = 1, increment i in a loop\n if i >= ch[now][0] && (i - ch[now][0]) % ch[now][1] = 0, increment num\n if now is greater than n\n print i\n return to indicate successful execution\n end of the block\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int ch[2000][2];\nint main() {\n int n;\n cin >> n;\n int now = 1;\n for (int i = 1; i <= n; i++) cin >> ch[i][0] >> ch[i][1];\n for (int i = 1; i; i++) {\n if (i >= ch[now][0] && (i - ch[now][0]) % ch[now][1] == 0) now++;\n if (now > n) {\n cout << i << endl;\n return 0;\n }\n }\n}","item":{"problem_id":"879A","pseudocode":"create integer 2d array ch with 2000 by 2 elements\ndefine the main function\n create integer n\n read n\n declare integer now = 1\n for integer i = 1 to n inclusive, read ch[i][0] and ch[i][1]\n for i = 1, increment i in a loop\n if i >= ch[now][0] && (i - ch[now][0]) % ch[now][1] = 0, increment num\n if now is greater than n\n print i\n return to indicate successful execution\n end of the block\n end of the block\nend of the block","testcases":[[["3","2 2","1 2","2 2"],["4"]],[["2","10 1","6 5"],["11"]],[["3","6 10","3 3","8 2"],["10"]],[["4","4 8","10 10","4 2","8 2"],["14"]],[["5","7 1","5 1","6 1","1 6","6 8"],["14"]],[["6","1 3","2 5","4 7","7 5","6 8","8 8"],["16"]],[["10","4 10","8 7","6 5","2 1","2 3","8 8","2 4","2 2","6 7","7 9"],["34"]],[["1","1 1"],["1"]],[["1","1000 1000"],["1000"]],[["42","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2"],["83"]],[["2","5 5","5 1"],["6"]],[["2","5 5","5 5"],["10"]],[["2","1 1","1 1"],["2"]],[["2","1 6","7 1"],["7"]],[["2","4 3","4 5"],["9"]],[["2","1 2","1 3"],["4"]],[["3","2 3","5 1","2 1"],["6"]],[["2","2 1","6 3"],["6"]],[["3","10 1","4 4","12 1"],["13"]],[["2","2 2","10 2"],["10"]],[["2","1 1","1000 2"],["1000"]],[["14","1000 1","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1 1"],["13001"]],[["2","2 4","2 1"],["3"]],[["3","1 100","100 3","200 1"],["200"]],[["7","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1 1"],["6001"]],[["2","5 5","15 5"],["15"]],[["2","2 2","2 4"],["6"]],[["2","1 1","10 1"],["10"]],[["2","10 1","100 1"],["100"]],[["15","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1000 1000","1 1"],["14001"]],[["3","2 1","1 3","4 7"],["11"]],[["2","5 5","100 5"],["100"]],[["2","1 10","2 30"],["2"]],[["4","2 2","2 2","2 2","2 2"],["8"]],[["1","10 10"],["10"]]]}} +{"instance_id":"pseudo_to_code_0.5k_31","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integers N, sum = 0\n read N\n declare integer pointer H = new integer array size 100\n declare integer pointer A = new integer array size 100\n for i = 0 to N exclusive\n read H[i]\n read A[i]\n end of the block\n for i = 0 to N exclusive\n for j = 0 to N exclusive\n if H[i] is A[j], increment sum\n end of the block\n end of the block\n print sum and newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int N, sum = 0;\n cin >> N;\n int *H = new int[100];\n int *A = new int[100];\n for (int i = 0; i < N; i++) {\n cin >> H[i];\n cin >> A[i];\n }\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (H[i] == A[j]) sum++;\n }\n }\n cout << sum << endl;\n return 0;\n}","item":{"problem_id":"268A","pseudocode":"define the main function\n declare integers N, sum = 0\n read N\n declare integer pointer H = new integer array size 100\n declare integer pointer A = new integer array size 100\n for i = 0 to N exclusive\n read H[i]\n read A[i]\n end of the block\n for i = 0 to N exclusive\n for j = 0 to N exclusive\n if H[i] is A[j], increment sum\n end of the block\n end of the block\n print sum and newline\n return to indicate successful execution\nend of the block","testcases":[[["3","1 2","2 4","3 4"],["1"]],[["4","100 42","42 100","5 42","100 5"],["5"]],[["2","1 2","1 2"],["0"]],[["7","4 7","52 55","16 4","55 4","20 99","3 4","7 52"],["6"]],[["10","68 42","1 35","25 70","59 79","65 63","46 6","28 82","92 62","43 96","37 28"],["1"]],[["30","10 39","89 1","78 58","75 99","36 13","77 50","6 97","79 28","27 52","56 5","93 96","40 21","33 74","26 37","53 59","98 56","61 65","42 57","9 7","25 63","74 34","96 84","95 47","12 23","34 21","71 6","27 13","15 47","64 14","12 77"],["6"]],[["30","46 100","87 53","34 84","44 66","23 20","50 34","90 66","17 39","13 22","94 33","92 46","63 78","26 48","44 61","3 19","41 84","62 31","65 89","23 28","58 57","19 85","26 60","75 66","69 67","76 15","64 15","36 72","90 89","42 69","45 35"],["4"]],[["2","46 6","6 46"],["2"]],[["29","8 18","33 75","69 22","97 95","1 97","78 10","88 18","13 3","19 64","98 12","79 92","41 72","69 15","98 31","57 74","15 56","36 37","15 66","63 100","16 42","47 56","6 4","73 15","30 24","27 71","12 19","88 69","85 6","50 11"],["10"]],[["23","43 78","31 28","58 80","66 63","20 4","51 95","40 20","50 14","5 34","36 39","77 42","64 97","62 89","16 56","8 34","58 16","37 35","37 66","8 54","50 36","24 8","68 48","85 33"],["6"]],[["13","76 58","32 85","99 79","23 58","96 59","72 35","53 43","96 55","41 78","75 10","28 11","72 7","52 73"],["0"]],[["18","6 90","70 79","26 52","67 81","29 95","41 32","94 88","18 58","59 65","51 56","64 68","34 2","6 98","95 82","34 2","40 98","83 78","29 2"],["1"]],[["18","6 90","100 79","26 100","67 100","29 100","100 32","94 88","18 58","59 65","51 56","64 68","34 2","6 98","95 82","34 2","40 98","83 78","29 100"],["8"]],[["30","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","2 1","2 1","2 1","2 1","2 1","2 1","2 1","2 1","2 1","2 1","2 1","2 1","2 1","2 1","2 1"],["450"]],[["30","100 99","58 59","56 57","54 55","52 53","50 51","48 49","46 47","44 45","42 43","40 41","38 39","36 37","34 35","32 33","30 31","28 29","26 27","24 25","22 23","20 21","18 19","16 17","14 15","12 13","10 11","8 9","6 7","4 5","2 3"],["0"]],[["15","9 3","2 6","7 6","5 10","9 5","8 1","10 5","2 8","4 5","9 8","5 3","3 8","9 8","4 10","8 5"],["20"]],[["15","2 1","1 2","1 2","1 2","2 1","2 1","2 1","1 2","2 1","2 1","2 1","1 2","2 1","2 1","1 2"],["108"]],[["25","2 1","1 2","1 2","1 2","2 1","1 2","1 2","1 2","2 1","2 1","2 1","1 2","1 2","1 2","2 1","2 1","2 1","1 2","2 1","1 2","2 1","2 1","2 1","2 1","1 2"],["312"]],[["25","91 57","2 73","54 57","2 57","23 57","2 6","57 54","57 23","91 54","91 23","57 23","91 57","54 2","6 91","57 54","2 57","57 91","73 91","57 23","91 57","2 73","91 2","23 6","2 73","23 6"],["96"]],[["28","31 66","31 91","91 31","97 66","31 66","31 66","66 91","91 31","97 31","91 97","97 31","66 31","66 97","91 31","31 66","31 66","66 31","31 97","66 97","97 31","31 91","66 91","91 66","31 66","91 66","66 31","66 31","91 97"],["210"]],[["29","78 27","50 68","24 26","68 43","38 78","26 38","78 28","28 26","27 24","23 38","24 26","24 43","61 50","38 78","27 23","61 26","27 28","43 23","28 78","43 27","43 78","27 61","28 38","61 78","50 26","43 27","26 78","28 50","43 78"],["73"]],[["29","80 27","69 80","27 80","69 80","80 27","80 27","80 27","80 69","27 69","80 69","80 27","27 69","69 27","80 69","27 69","69 80","27 69","80 69","80 27","69 27","27 69","27 80","80 27","69 80","27 69","80 69","69 80","69 80","27 80"],["277"]],[["30","19 71","7 89","89 71","21 7","19 21","7 89","19 71","89 8","89 21","19 8","21 7","8 89","19 89","7 21","19 8","19 7","7 19","8 21","71 21","71 89","7 19","7 19","21 7","21 19","21 19","71 8","21 8","71 19","19 71","8 21"],["154"]],[["30","44 17","44 17","44 17","17 44","44 17","44 17","17 44","17 44","17 44","44 17","44 17","44 17","44 17","44 17","17 44","17 44","17 44","44 17","44 17","17 44","44 17","44 17","44 17","17 44","17 44","44 17","17 44","44 17","44 17","44 17"],["418"]],[["22","78 92","15 92","92 78","78 80","92 16","24 80","92 16","16 92","78 16","24 78","80 78","92 80","16 80","80 78","15 78","92 16","24 15","24 80","80 16","16 80","92 80","24 80"],["74"]],[["24","9 83","90 31","83 3","83 3","21 31","83 3","32 31","12 21","31 21","90 32","32 21","12 9","12 31","9 83","83 12","32 3","32 83","90 31","9 32","31 21","83 90","32 21","21 3","32 9"],["59"]],[["30","67 21","85 39","85 87","21 39","66 85","10 95","10 21","87 85","82 21","67 21","95 10","21 39","82 21","21 66","66 39","95 30","67 85","66 82","85 82","21 66","10 39","67 10","21 85","10 82","85 95","10 85","21 39","85 39","39 10","95 67"],["100"]],[["4","8 7","8 7","7 8","7 8"],["8"]],[["6","1 2","1 2","1 2","1 2","1 2","2 1"],["10"]],[["12","1 2","1 2","1 2","1 2","1 2","1 2","2 1","2 1","2 1","2 1","2 1","2 1"],["72"]],[["4","1 2","1 2","2 1","2 1"],["8"]]]}} +{"instance_id":"pseudo_to_code_0.5k_32","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integer r,c, row=array of 0 of length 11, col = array of 0 of length 11\n Create string s\n Read r and c\n for (i=0 to r(exclusive))\n read s\n for (j=0 to c(exclusive))\n if(s[j] is 'S') execute\n row[i]=1\n col[j]=1\n end of the block\n end of the block\n end of the block\n Create integer cakes=0\n for (i=0 to r(exclusive))\n for (j=0 to c(exclusive))\n if(row[i]==0 or col[j]==0) increment cakes by 1\n end of the block\n end of the block\n print out cakes\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int r, c, row[11] = {0}, col[11] = {0};\n string s;\n cin >> r >> c;\n for (int i = 0; i < r; ++i) {\n cin >> s;\n for (int j = 0; j < c; ++j) {\n if (s[j] == 'S') {\n row[i] = 1;\n col[j] = 1;\n }\n }\n }\n int cakes(0);\n for (int i = 0; i < r; ++i) {\n for (int j = 0; j < c; ++j) {\n if (row[i] == 0 || col[j] == 0) { cakes += 1; }\n }\n }\n cout << cakes << endl;\n return 0;\n}","item":{"problem_id":"330A","pseudocode":"define the main function\n create integer r,c, row=array of 0 of length 11, col = array of 0 of length 11\n Create string s\n Read r and c\n for (i=0 to r(exclusive))\n read s\n for (j=0 to c(exclusive))\n if(s[j] is 'S') execute\n row[i]=1\n col[j]=1\n end of the block\n end of the block\n end of the block\n Create integer cakes=0\n for (i=0 to r(exclusive))\n for (j=0 to c(exclusive))\n if(row[i]==0 or col[j]==0) increment cakes by 1\n end of the block\n end of the block\n print out cakes\n return to indicate successful execution\nend of the block","testcases":[[["3 4","S...","....","..S."],["8"]],[["2 2","..",".."],["4"]],[["2 2","SS","SS"],["0"]],[["7 3","S..","S..","S..","S..","S..","S..","S.."],["14"]],[["3 5","..S..","SSSSS","..S.."],["0"]],[["10 10","SSSSSSSSSS","SSSSSSSSSS","SSSSSSSSSS","SSSSSSSSSS","SSSSSSSSSS","SSSSSSSSSS","SSSSSSSSSS","SSSSSSSSSS","SSSSSSSSSS","SSSSSSSSSS"],["0"]],[["10 10","S...SSSSSS","S...SSSSSS","S...SSSSSS","S...SSSSSS","S...SSSSSS","S...SSSSSS","S...SSSSSS","S...SSSSSS","S...SSSSSS","S...SSSSSS"],["30"]],[["10 10","....S..S..","....S..S..","....S..S..","....S..S..","....S..S..","....S..S..","....S..S..","....S..S..","....S..S..","....S..S.."],["80"]],[["9 5","SSSSS","SSSSS","SSSSS","SSSSS","SSSSS","SSSSS","SSSSS","SSSSS","SSSSS"],["0"]],[["9 9","...S.....","S.S.....S",".S....S..",".S.....SS",".........","..S.S..S.",".SS......","....S....","..S...S.."],["17"]],[["5 6","SSSSSS","SSSSSS","SSSSSS","SS.S..","S.S.SS"],["0"]],[["9 8","........",".......S","........","S.......","........","........","S.......","........",".......S"],["64"]],[["9 7","......S","......S","S.S.S..",".......",".......",".S.....",".S....S","..S....",".S....S"],["28"]],[["10 10",".....S....","....SS..S.",".S...S....","........SS",".S.......S","SS..S.....",".SS.....SS","S..S......",".......SSS","SSSSS....S"],["10"]],[["6 7","..S.SS.","......S","....S.S","SS..S..","S..SS.S",".....S."],["0"]],[["10 6",".SSSSS","SSS.SS","SSSSSS","S.SSSS","SSSSS.","S.SSSS","SS.SSS",".SSS.S",".SSS..","SS..SS"],["0"]],[["2 2","..",".."],["4"]],[["3 2","S.",".S","S."],["0"]],[["3 2","S.",".S","S."],["0"]],[["4 3",".S.","S.S",".S.","S.S"],["0"]],[["2 3","...","SSS"],["3"]],[["2 4","S.SS","S.SS"],["2"]],[["2 2","..",".S"],["3"]],[["3 2",".S",".S","SS"],["0"]],[["2 4","SS.S","..S."],["0"]],[["2 3","...","S.."],["5"]]]}} +{"instance_id":"pseudo_to_code_0.5k_33","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nlet y, m and s be integer arrays with size 5\ncreate integers ans, atkm, atky, mm, my, j, i and sum\ndefine the main function\n for i = 1 to 3 inclusive, read y[i]\n for i = 1 to 3 inclusive, read m[i]\n for i = 1 to 3 inclusive, read s[i]\n ans = 999999\n for i = 0 to 200 inclusive\n for j = 0 to 200 inclusive\n sum = s[3] * j + s[2] * i\n atky = i + y[2] - m[3]\n atkm = m[2] - j - y[3]\n skip the rest of the loop if atky <= 0\n if atkm <= 0\n ans = min of ans and sum\n skip the rest of the loop\n end of the block\n if m[1] modulo atky != 0\n mm = m[1] \/ atky + 1\n else\n mm = m[1] \/ atky\n end of the block\n if y[1] modulo atkm != 0\n my = y[1] \/ atkm + 1\n else\n my = y[1] \/ atkm\n end of the block\n if my <= mm, increase sum by (mm * atkm + 1 - y[1]) * s[1]\n set ans to min of ans and sum\n end of the block\n end of the block\n print ans\nend of the block\n\n[CODE]:","reference_output":"int y[5], m[5], s[5];\nint ans, atkm, atky, mm, my, j, i, sum;\nint main() {\n for (i = 1; i <= 3; i++) { cin >> y[i]; }\n for (i = 1; i <= 3; i++) { cin >> m[i]; }\n for (i = 1; i <= 3; i++) { cin >> s[i]; }\n ans = 999999;\n for (i = 0; i <= 200; i++) {\n for (j = 0; j <= 200; j++) {\n sum = s[3] * j + s[2] * i;\n atky = i + y[2] - m[3];\n atkm = m[2] - j - y[3];\n if (atky <= 0) { continue; }\n if (atkm <= 0) {\n ans = min(ans, sum);\n continue;\n }\n if (m[1] % atky != 0) {\n mm = m[1] \/ atky + 1;\n } else {\n mm = m[1] \/ atky;\n }\n if (y[1] % atkm != 0) {\n my = y[1] \/ atkm + 1;\n } else {\n my = y[1] \/ atkm;\n }\n if (my <= mm) { sum += (mm * atkm + 1 - y[1]) * s[1]; }\n ans = min(ans, sum);\n }\n }\n cout << ans << endl;\n}","item":{"problem_id":"487A","pseudocode":"let y, m and s be integer arrays with size 5\ncreate integers ans, atkm, atky, mm, my, j, i and sum\ndefine the main function\n for i = 1 to 3 inclusive, read y[i]\n for i = 1 to 3 inclusive, read m[i]\n for i = 1 to 3 inclusive, read s[i]\n ans = 999999\n for i = 0 to 200 inclusive\n for j = 0 to 200 inclusive\n sum = s[3] * j + s[2] * i\n atky = i + y[2] - m[3]\n atkm = m[2] - j - y[3]\n skip the rest of the loop if atky <= 0\n if atkm <= 0\n ans = min of ans and sum\n skip the rest of the loop\n end of the block\n if m[1] modulo atky != 0\n mm = m[1] \/ atky + 1\n else\n mm = m[1] \/ atky\n end of the block\n if y[1] modulo atkm != 0\n my = y[1] \/ atkm + 1\n else\n my = y[1] \/ atkm\n end of the block\n if my <= mm, increase sum by (mm * atkm + 1 - y[1]) * s[1]\n set ans to min of ans and sum\n end of the block\n end of the block\n print ans\nend of the block","testcases":[[["1 2 1","1 100 1","1 100 100"],["99"]],[["100 100 100","1 1 1","1 1 1"],["0"]],[["50 80 92","41 51 56","75 93 12"],["0"]],[["76 63 14","89 87 35","20 15 56"],["915"]],[["12 59 66","43 15 16","12 18 66"],["0"]],[["51 89 97","18 25 63","22 91 74"],["0"]],[["72 16 49","5 21 84","48 51 88"],["3519"]],[["74 89 5","32 76 99","62 95 36"],["3529"]],[["39 49 78","14 70 41","3 33 23"],["0"]],[["11 82 51","90 84 72","98 98 43"],["1376"]],[["65 6 5","70 78 51","88 55 78"],["7027"]],[["14 61 87","11 78 14","5 84 92"],["0"]],[["1 28 47","31 60 38","14 51 77"],["1562"]],[["99 32 20","89 72 74","1 100 39"],["5478"]],[["1 10 29","1 1 43","1 1 100"],["34"]],[["1 1 100","1 1 1","100 1 100"],["1"]],[["79 1 1","1 1 10","1 1 100"],["10"]],[["10 10 100","1 100 100","10 100 90"],["9100"]],[["10 10 100","1 10 1","1 1 100"],["0"]],[["1 100 1","1 1 1","1 1 1"],["0"]],[["11 1 1","100 1 1","100 1 1"],["1"]],[["1 100 100","1 1 1","87 100 43"],["0"]],[["10 100 1","1 100 100","100 1 9"],["811"]],[["10 100 55","100 100 1","1 1 1"],["37"]],[["11 1 1","10 1 10","100 50 1"],["500"]],[["10 100 1","100 1 1","1 100 1"],["0"]],[["1 10 10","1 10 100","1 1 61"],["91"]],[["1 1 1","1 1 1","1 1 1"],["1"]],[["1 1 1","1 1 1","100 100 100"],["100"]],[["1 1 1","100 100 100","100 100 100"],["19900"]],[["100 100 100","1 1 1","1 1 1"],["0"]],[["100 100 100","100 100 100","100 100 100"],["100"]],[["1 1 1","1 1 100","100 100 1"],["10000"]],[["50 100 51","100 100 100","1 100 100"],["1384"]],[["1 1 1","100 100 100","1 2 3"],["496"]],[["100 1 1","100 100 100","100 1 100"],["199"]],[["1 100 1","100 100 100","1 100 100"],["1990"]],[["100 100 1","100 100 100","1 100 100"],["1891"]],[["1 1 1","100 100 100","1 100 100"],["11890"]],[["20 1 1","100 100 100","1 100 100"],["11871"]],[["25 38 49","84 96 42","3 51 92"],["1692"]],[["2 1 1","100 2 100","100 1 100"],["199"]],[["1 97 1","100 99 98","1 51 52"],["1498"]],[["1 1 1","100 100 100","1 1 100"],["298"]],[["1 100 1","100 100 99","1 100 100"],["1890"]],[["100 1 1","100 100 100","1 100 100"],["11791"]]]}} +{"instance_id":"pseudo_to_code_0.5k_34","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nset max_n to 100 + 10\ncreate long long a[max_n]\ncreate int n\ncreate long long ans and x, set ans to 1e3\ndefine the main function\n read n\n for i=0 to n exclusive, read a[i]\n for i=1 to n - 1 exclusive\n for j=1 to n exclusive\n if j equal to i\n set x to max of a[j + 1] - a[j - 1] and x\n else if j - 1 different from i\n assign max of a[j] - a[j - 1] and x to x\n end of the block\n set ans to min of ans and x\n x=0\n end of the block\n print ans and a newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int max_n = 100 + 10;\nlong long a[max_n];\nshort int n;\nlong long ans = 1e3, x;\nint main() {\n cin >> n;\n for (int i = 0; i < n; i++) cin >> a[i];\n for (int i = 1; i < n - 1; i++) {\n for (int j = 1; j < n; j++) {\n if (j == i)\n x = max(a[j + 1] - a[j - 1], x);\n else if (j - 1 != i)\n x = max(a[j] - a[j - 1], x);\n }\n ans = min(ans, x);\n x = 0;\n }\n cout << ans << '\\n';\n return 0;\n}","item":{"problem_id":"496A","pseudocode":"set max_n to 100 + 10\ncreate long long a[max_n]\ncreate int n\ncreate long long ans and x, set ans to 1e3\ndefine the main function\n read n\n for i=0 to n exclusive, read a[i]\n for i=1 to n - 1 exclusive\n for j=1 to n exclusive\n if j equal to i\n set x to max of a[j + 1] - a[j - 1] and x\n else if j - 1 different from i\n assign max of a[j] - a[j - 1] and x to x\n end of the block\n set ans to min of ans and x\n x=0\n end of the block\n print ans and a newline\n return to indicate successful execution\nend of the block","testcases":[[["3","1 4 6"],["5"]],[["5","1 2 3 4 5"],["2"]],[["5","1 2 3 7 8"],["4"]],[["3","1 500 1000"],["999"]],[["10","1 2 3 4 5 6 7 8 9 10"],["2"]],[["10","1 4 9 16 25 36 49 64 81 100"],["19"]],[["10","300 315 325 338 350 365 379 391 404 416"],["23"]],[["15","87 89 91 92 93 95 97 99 101 103 105 107 109 111 112"],["2"]],[["60","3 5 7 8 15 16 18 21 24 26 40 41 43 47 48 49 50 51 52 54 55 60 62 71 74 84 85 89 91 96 406 407 409 412 417 420 423 424 428 431 432 433 436 441 445 446 447 455 458 467 469 471 472 475 480 485 492 493 497 500"],["310"]],[["3","159 282 405"],["246"]],[["81","6 7 22 23 27 38 40 56 59 71 72 78 80 83 86 92 95 96 101 122 125 127 130 134 154 169 170 171 172 174 177 182 184 187 195 197 210 211 217 223 241 249 252 253 256 261 265 269 274 277 291 292 297 298 299 300 302 318 338 348 351 353 381 386 387 397 409 410 419 420 428 430 453 460 461 473 478 493 494 500 741"],["241"]],[["10","218 300 388 448 535 629 680 740 836 925"],["111"]],[["100","6 16 26 36 46 56 66 76 86 96 106 116 126 136 146 156 166 176 186 196 206 216 226 236 246 256 266 276 286 296 306 316 326 336 346 356 366 376 386 396 406 416 426 436 446 456 466 476 486 496 506 516 526 536 546 556 566 576 586 596 606 616 626 636 646 656 666 676 686 696 706 716 726 736 746 756 766 776 786 796 806 816 826 836 846 856 866 876 886 896 906 916 926 936 946 956 966 976 986 996"],["20"]],[["100","1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000"],["901"]],[["100","1 9 15 17 28 29 30 31 32 46 48 49 52 56 62 77 82 85 90 91 94 101 102 109 111 113 116 118 124 125 131 132 136 138 139 143 145 158 161 162 165 167 171 173 175 177 179 183 189 196 801 802 804 806 817 819 827 830 837 840 842 846 850 855 858 862 863 866 869 870 878 881 883 884 896 898 899 901 904 906 908 909 910 911 912 917 923 924 925 935 939 943 945 956 963 964 965 972 976 978"],["605"]],[["100","2 43 47 49 50 57 59 67 74 98 901 903 904 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 938 939 940 942 943 944 945 946 947 948 949 950 952 953 954 956 957 958 959 960 961 962 963 965 966 967 968 969 970 971 972 973 974 975 976 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 998 999"],["803"]],[["72","178 186 196 209 217 226 236 248 260 273 281 291 300 309 322 331 343 357 366 377 389 399 409 419 429 442 450 459 469 477 491 501 512 524 534 548 557 568 582 593 602 616 630 643 652 660 670 679 693 707 715 728 737 750 759 768 776 789 797 807 815 827 837 849 863 873 881 890 901 910 920 932"],["17"]],[["38","1 28 55 82 109 136 163 190 217 244 271 298 325 352 379 406 433 460 487 514 541 568 595 622 649 676 703 730 757 784 811 838 865 892 919 946 973 1000"],["54"]],[["28","1 38 75 112 149 186 223 260 297 334 371 408 445 482 519 556 593 630 667 704 741 778 815 852 889 926 963 1000"],["74"]]]}} +{"instance_id":"pseudo_to_code_0.5k_35","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let y,b,r be integers\n read y,b and r\n for (int i is equal to r, i greater than or equal to 3, i--)\n if (i less than or equal to r and i - 1 less than or equal to b and i - 2 less than or equal to y)\n print 3 * i - 3 and newline\n stop\n end of the block\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int y, b, r;\n cin >> y >> b >> r;\n for (int i = r; i >= 3; i--) {\n if (i <= r && i - 1 <= b && i - 2 <= y) {\n cout << 3 * i - 3 << endl;\n break;\n }\n }\n return 0;\n}","item":{"problem_id":"1091A","pseudocode":"define the main function\n let y,b,r be integers\n read y,b and r\n for (int i is equal to r, i greater than or equal to 3, i--)\n if (i less than or equal to r and i - 1 less than or equal to b and i - 2 less than or equal to y)\n print 3 * i - 3 and newline\n stop\n end of the block\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["8 13 9"],["24"]],[["13 3 6"],["9"]],[["3 8 20"],["12"]],[["1 2 3"],["6"]],[["100 100 100"],["297"]],[["9 5 5"],["12"]],[["88 89 7"],["18"]],[["50 80 70"],["153"]],[["80 81 82"],["243"]],[["100 98 99"],["294"]],[["65 69 67"],["198"]],[["55 56 76"],["168"]],[["78 3 79"],["9"]],[["4 49 50"],["15"]],[["80 90 80"],["237"]],[["40 50 50"],["123"]],[["70 70 80"],["210"]],[["50 20 50"],["60"]],[["90 56 56"],["165"]],[["66 66 37"],["108"]],[["25 25 25"],["72"]],[["98 99 99"],["294"]],[["99 100 99"],["294"]],[["99 100 100"],["297"]],[["48 3 50"],["9"]],[["1 3 4"],["6"]],[["1 27 4"],["6"]],[["6 5 7"],["15"]],[["1 5 4"],["6"]],[["10 10 20"],["30"]],[["3 2 4"],["6"]],[["3 3 5"],["9"]],[["6 10 9"],["21"]],[["5 5 56"],["15"]],[["3 2 3"],["6"]],[["10 20 20"],["33"]],[["4 5 5"],["12"]],[["1 90 20"],["6"]],[["2 2 4"],["6"]],[["1 100 100"],["6"]],[["3 3 9"],["9"]],[["2 2 5"],["6"]]]}} +{"instance_id":"pseudo_to_code_0.5k_36","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n define new integers n, k and m\n read user input to n, k and m\n declare an array of ints c with m + 2 elements and new variables i, j and r with r = m\n read m elements from the input to c starting from the index 1\n set c[m + 1] to n\n if m = 0, set r to n \/ k\n if m >= 1\n for i = 1 to m inclusive, increase r by (c[i] - c[i - 1] - 1) \/ k\n change r to r + (c[m + 1] - c[m]) \/ k\n end of the block\n print r\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, k, m;\n cin >> n >> k >> m;\n int c[m + 2] = {}, i, j, r = m;\n for (i = 1; i <= m; i++) cin >> c[i];\n c[m + 1] = n;\n if (m == 0) r = n \/ k;\n if (m >= 1) {\n for (i = 1; i <= m; i++) r += ((c[i] - c[i - 1] - 1) \/ k);\n r += ((c[m + 1] - c[m]) \/ k);\n }\n cout << r << endl;\n return 0;\n}","item":{"problem_id":"54A","pseudocode":"define the main function\n define new integers n, k and m\n read user input to n, k and m\n declare an array of ints c with m + 2 elements and new variables i, j and r with r = m\n read m elements from the input to c starting from the index 1\n set c[m + 1] to n\n if m = 0, set r to n \/ k\n if m >= 1\n for i = 1 to m inclusive, increase r by (c[i] - c[i - 1] - 1) \/ k\n change r to r + (c[m + 1] - c[m]) \/ k\n end of the block\n print r\n return to indicate successful execution\nend of the block","testcases":[[["5 2","1 3"],["3"]],[["10 1","3 6 7 8"],["10"]],[["5 5","1 3"],["1"]],[["10 3","3 3 6 9"],["3"]],[["5 2","0"],["2"]],[["1 1","0"],["1"]],[["5 1","0"],["5"]],[["5 1","1 2"],["5"]],[["5 2","0"],["2"]],[["10 3","2 4 8"],["4"]],[["10 1","0"],["10"]],[["10 2","1 5"],["5"]],[["10 1","0"],["10"]],[["10 1","0"],["10"]],[["15 5","0"],["3"]],[["15 1","1 3"],["15"]],[["15 2","1 10"],["7"]],[["15 1","0"],["15"]],[["15 3","1 11"],["5"]],[["20 1","3 7 9 20"],["20"]],[["20 3","1 11"],["7"]],[["20 2","6 6 9 10 15 19 20"],["12"]],[["20 1","0"],["20"]],[["20 1","1 13"],["20"]],[["25 1","9 2 6 8 10 14 15 17 18 23"],["25"]],[["25 1","0"],["25"]],[["25 1","4 8 10 13 24"],["25"]],[["25 1","1 14"],["25"]],[["25 1","0"],["25"]],[["100 3","0"],["33"]],[["100 10","0"],["10"]],[["100 23","22 2 9 18 22 23 30 44 50 55 58 61 70 71 73 76 79 82 85 88 94 95 99"],["22"]],[["100 5","10 2 17 21 34 52 58 60 64 68 95"],["24"]],[["100 4","2 29 63"],["26"]],[["150 16","9 19 31 47 53 57 96 105 108 120"],["13"]],[["150 52","5 11 37 60 67 86"],["6"]],[["150 4","7 21 54 106 108 109 119 123"],["40"]],[["150 3","0"],["50"]],[["150 21","21 22 26 30 36 39 52 59 62 66 68 78 86 92 96 103 108 113 118 119 125 139"],["22"]],[["300 15","14 3 38 52 57 142 157 175 201 209 238 258 288 294 299"],["26"]],[["300 2","14 29 94 122 123 158 160 164 191 200 202 208 246 272 286"],["153"]],[["300 5","16 22 38 72 78 108 116 140 147 160 189 209 214 227 252 294 300"],["66"]],[["300 8","4 27 76 155 260"],["40"]],[["300 24","20 18 76 80 81 85 103 110 112 129 145 151 172 180 184 201 205 241 257 268 276"],["24"]],[["350 22","11 38 111 115 176 194 204 207 231 274 307 348"],["21"]],[["350 22","73 1 4 8 10 14 16 19 28 37 41 42 43 55 56 64 66 67 79 80 84 87 96 99 101 103 119 120 121 122 127 128 135 141 142 143 148 156 159 160 161 166 167 169 173 189 201 202 205 219 223 227 233 242 243 244 250 257 260 262 263 264 273 291 301 302 305 306 307 314 326 336 342 345"],["73"]],[["350 26","10 13 16 81 99 144 191 223 258 316 329"],["18"]],[["350 16","12 31 76 103 116 191 201 241 256 260 291 306 336"],["24"]],[["350 28","5 23 104 135 305 331"],["14"]],[["365 34","6 80 94 208 256 325 349"],["14"]],[["365 19","7 47 114 139 210 226 266 279"],["22"]],[["365 8","32 1 13 22 25 33 72 80 86 96 117 132 145 146 156 176 177 179 188 198 203 218 225 235 253 256 267 279 286 294 303 333 363"],["61"]],[["365 8","55 3 12 26 28 36 45 47 59 61 65 82 90 103 109 114 117 121 123 126 134 142 144 146 151 154 168 175 189 193 195 197 199 210 212 214 230 232 241 248 254 267 271 291 304 306 308 311 315 317 318 334 335 346 354 365"],["74"]],[["365 2","2 96 241"],["183"]],[["365 42","10 8 66 77 148 161 183 231 301 340 350"],["14"]],[["365 40","30 1 14 21 31 32 36 56 59 68 96 119 131 137 166 179 181 202 235 248 272 294 309 315 322 327 334 341 347 362 365"],["30"]],[["365 31","19 13 18 27 33 46 58 86 114 178 187 198 228 233 240 255 277 332 348 351"],["22"]],[["365 54","21 28 42 56 65 66 67 76 81 85 89 123 132 136 153 195 215 249 294 296 300 355"],["22"]],[["365 5","5 10 31 121 235 322"],["74"]],[["365 81","2 1 75"],["5"]],[["365 21","4 1 17 344 345"],["19"]],[["11 2","5 3 6 7 9 10"],["7"]],[["5 3","2 2 4"],["2"]],[["362 360","0"],["1"]],[["18 4","4 1 9 10 18"],["6"]]]}} +{"instance_id":"pseudo_to_code_0.5k_37","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nn, t, a, ans = integers with a = array of size 1000000\ndefine the main function\n read n, t\n for i = 1 to n\n read a[i]\n t = t - 86400 - a[i]\n if (t <= 0 and not ans), ans = i\n end of the block\n print ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int n, t, a[1000000], ans;\nint main() {\n cin >> n >> t;\n for (register int i = 1; i <= n; i++) {\n cin >> a[i];\n t -= 86400 - a[i];\n if (t <= 0 && !ans) ans = i;\n }\n cout << ans << endl;\n return 0;\n}","item":{"problem_id":"884A","pseudocode":"n, t, a, ans = integers with a = array of size 1000000\ndefine the main function\n read n, t\n for i = 1 to n\n read a[i]\n t = t - 86400 - a[i]\n if (t <= 0 and not ans), ans = i\n end of the block\n print ans\n return to indicate successful execution\nend of the block","testcases":[[["2 2","86400 86398"],["2"]],[["2 86400","0 86400"],["1"]],[["2 86400","1 86399"],["2"]],[["100 1000000","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 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 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 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"],["12"]],[["1 1","86399"],["1"]],[["6 1200","86400 86400 86000 86000 86000 86400"],["5"]],[["6 1200","86400 86400 86000 86000 86001 86399"],["6"]],[["4 172799","1 1 86400 0"],["4"]],[["4 172799","0 86400 86399 0"],["4"]],[["6 1","1 1 86400 1 86399 1"],["1"]],[["4 1","86400 86399 86400 86400"],["2"]],[["4 1","86400 86400 0 86400"],["3"]]]}} +{"instance_id":"pseudo_to_code_0.5k_38","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare count taking long long n and returning long long\n make long long ints k = n and s = 0\n while k is greater than 0\n set s to s + k % 10\n divide k by 10\n end of the block\n return s\nend of the block\ndeclare si taking in long long n and returning long long\n make long long integers k = n and s = 0\n while k is greater than 0\n increment s\n set k to k \/ 10\n end of the block\n return s\nend of the block\nmake long long vector v of size 1000000\ndefine the main function\n make long long ints n and i\n read n\n create long long ints k = 0 and m = n\n make long long int l = si(n)\n set i to n\n create long long int c = 0\n create long long vector p\n make long long ints j = 9 * l and q = 0\n while q is less than or equal to j\n increase q by 1\n create long long z = i + count(i)\n if z is equal to n\n increase c by 1\n append i to p\n end of the block\n decrease i by 1\n end of the block\n print c\n sort vector p\n for i = 0 to p.size() exclusive, print p[i]\nend of the block\n\n[CODE]:","reference_output":"long long count(long long n) {\n long long k = n, s = 0;\n while (k > 0) {\n s += k % 10;\n k \/= 10;\n }\n return s;\n}\nlong long si(long long n) {\n long long k = n, s = 0;\n while (k > 0) {\n s++;\n k \/= 10;\n }\n return s;\n}\nvector v[1000000];\nint main() {\n long long n, i;\n cin >> n;\n long long k = 0, m = n;\n long long l = si(n);\n i = n;\n long long c = 0;\n vector p;\n long long j = 9 * l, q = 0;\n while (q <= j) {\n q++;\n long long z = i + count(i);\n if (z == n) {\n c++;\n p.push_back(i);\n }\n i--;\n }\n cout << c << endl;\n sort(p.begin(), p.end());\n for (i = 0; i < p.size(); i++) cout << p[i] << endl;\n}","item":{"problem_id":"875A","pseudocode":"declare count taking long long n and returning long long\n make long long ints k = n and s = 0\n while k is greater than 0\n set s to s + k % 10\n divide k by 10\n end of the block\n return s\nend of the block\ndeclare si taking in long long n and returning long long\n make long long integers k = n and s = 0\n while k is greater than 0\n increment s\n set k to k \/ 10\n end of the block\n return s\nend of the block\nmake long long vector v of size 1000000\ndefine the main function\n make long long ints n and i\n read n\n create long long ints k = 0 and m = n\n make long long int l = si(n)\n set i to n\n create long long int c = 0\n create long long vector p\n make long long ints j = 9 * l and q = 0\n while q is less than or equal to j\n increase q by 1\n create long long z = i + count(i)\n if z is equal to n\n increase c by 1\n append i to p\n end of the block\n decrease i by 1\n end of the block\n print c\n sort vector p\n for i = 0 to p.size() exclusive, print p[i]\nend of the block","testcases":[[["21"],["1","15"]],[["20"],["0"]],[["1"],["0"]],[["2"],["1","1"]],[["3"],["0"]],[["100000001"],["2","99999937","100000000"]],[["1000000000"],["1","999999932"]],[["999999979"],["2","999999899","999999908"]],[["9"],["0"]],[["10"],["1","5"]],[["11"],["1","10"]],[["39"],["1","33"]],[["66"],["1","60"]],[["75"],["0"]],[["100"],["1","86"]],[["101"],["2","91","100"]],[["2014"],["2","1988","2006"]],[["999999994"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_39","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n define ints a, m and d\n read m and d and loop\n if m = 1 or 3 or 5 or 7 or 8 or 10 or 12\n if (31 + d - 1) modulo 7 != 0\n print (31 + d - 1) \/ 7 + 1 to the output\n else\n print (31 + d - 1) \/ 7\n else if m is equal to 2\n if (28 + d - 1) % 7 is not 0\n print (28 + d - 1) \/ 7 + 1\n else\n print (28 + d - 1) \/ 7 to the standard output\n else if (30 + d - 1) % 7 != 0\n print (30 + d - 1) \/ 7 + 1\n else\n print (30 + d - 1) \/ 7 to the stdout\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int a, m, d;\n while (cin >> m >> d) {\n if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)\n if ((31 + d - 1) % 7 != 0)\n cout << (31 + d - 1) \/ 7 + 1 << endl;\n else\n cout << (31 + d - 1) \/ 7 << endl;\n else if (m == 2)\n if ((28 + d - 1) % 7 != 0)\n cout << (28 + d - 1) \/ 7 + 1 << endl;\n else\n cout << (28 + d - 1) \/ 7 << endl;\n else if ((30 + d - 1) % 7 != 0)\n cout << (30 + d - 1) \/ 7 + 1 << endl;\n else\n cout << (30 + d - 1) \/ 7 << endl;\n }\n return 0;\n}","item":{"problem_id":"760A","pseudocode":"define the main function\n define ints a, m and d\n read m and d and loop\n if m = 1 or 3 or 5 or 7 or 8 or 10 or 12\n if (31 + d - 1) modulo 7 != 0\n print (31 + d - 1) \/ 7 + 1 to the output\n else\n print (31 + d - 1) \/ 7\n else if m is equal to 2\n if (28 + d - 1) % 7 is not 0\n print (28 + d - 1) \/ 7 + 1\n else\n print (28 + d - 1) \/ 7 to the standard output\n else if (30 + d - 1) % 7 != 0\n print (30 + d - 1) \/ 7 + 1\n else\n print (30 + d - 1) \/ 7 to the stdout\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["1 7"],["6"]],[["1 1"],["5"]],[["11 6"],["5"]],[["2 7"],["5"]],[["2 1"],["4"]],[["8 6"],["6"]],[["1 1"],["5"]],[["1 2"],["5"]],[["1 3"],["5"]],[["1 4"],["5"]],[["1 5"],["5"]],[["1 6"],["6"]],[["1 7"],["6"]],[["2 1"],["4"]],[["2 2"],["5"]],[["2 3"],["5"]],[["2 4"],["5"]],[["2 5"],["5"]],[["2 6"],["5"]],[["2 7"],["5"]],[["3 1"],["5"]],[["3 2"],["5"]],[["3 3"],["5"]],[["3 4"],["5"]],[["3 5"],["5"]],[["3 6"],["6"]],[["3 7"],["6"]],[["4 1"],["5"]],[["4 2"],["5"]],[["4 3"],["5"]],[["4 4"],["5"]],[["4 5"],["5"]],[["4 6"],["5"]],[["4 7"],["6"]],[["5 1"],["5"]],[["5 2"],["5"]],[["5 3"],["5"]],[["5 4"],["5"]],[["5 5"],["5"]],[["5 6"],["6"]],[["5 7"],["6"]],[["6 1"],["5"]],[["6 2"],["5"]],[["6 3"],["5"]],[["6 4"],["5"]],[["6 5"],["5"]],[["6 6"],["5"]],[["6 7"],["6"]],[["7 1"],["5"]],[["7 2"],["5"]],[["7 3"],["5"]],[["7 4"],["5"]],[["7 5"],["5"]],[["7 6"],["6"]],[["7 7"],["6"]],[["8 1"],["5"]],[["8 2"],["5"]],[["8 3"],["5"]],[["8 4"],["5"]],[["8 5"],["5"]],[["8 6"],["6"]],[["8 7"],["6"]],[["9 1"],["5"]],[["9 2"],["5"]],[["9 3"],["5"]],[["9 4"],["5"]],[["9 5"],["5"]],[["9 6"],["5"]],[["9 7"],["6"]],[["10 1"],["5"]],[["10 2"],["5"]],[["10 3"],["5"]],[["10 4"],["5"]],[["10 5"],["5"]],[["10 6"],["6"]],[["10 7"],["6"]],[["11 1"],["5"]],[["11 2"],["5"]],[["11 3"],["5"]],[["11 4"],["5"]],[["11 5"],["5"]],[["11 6"],["5"]],[["11 7"],["6"]],[["12 1"],["5"]],[["12 2"],["5"]],[["12 3"],["5"]],[["12 4"],["5"]],[["12 5"],["5"]],[["12 6"],["6"]],[["12 7"],["6"]],[["1 4"],["5"]],[["1 5"],["5"]],[["9 7"],["6"]],[["2 6"],["5"]],[["1 6"],["6"]],[["2 2"],["5"]],[["4 7"],["6"]],[["12 6"],["6"]],[["12 3"],["5"]],[["3 6"],["6"]],[["9 6"],["5"]],[["7 6"],["6"]],[["11 7"],["6"]],[["6 6"],["5"]]]}} +{"instance_id":"pseudo_to_code_0.5k_40","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nMAXN = constant long long integer = 200100, md = constant long long integer of size 998244353\ndefine the main function\n n, h, a, b, k, ta, fa, tb, fb = long longs\n read n, h, a, b, k\n while looping decrease k by 1\n read ta, fa, tb, fb\n ans = long long = the absolute value of the result of ta - tb\n if ans is not zero\n if fa > b or fa < a\n ans = ans + the lower value between the absolute value of the result of fa - a + the absolute value of the result of fb - a, and the absolute value of the result of fa - b + the absolute value of the result of fb - b\n else if fb > b or fb < a\n ans = ans + the lower value between the absolute value of the result of fb - b + the absolute value of the result of fa - b, and the absolute value of the result of fb - a + the absolute value of the result of fa - a\n else\n ans = ans + the absolute value of the result of fa - fb\n end of the block\n else\n ans = ans + the absolute value of the result of fa - fb\n end of the block\n print ans\n end of the block\nend of the block\n\n[CODE]:","reference_output":"const long long MAXN = 200100, md = 998244353;\nint main() {\n long long n, h, a, b, k, ta, fa, tb, fb;\n cin >> n >> h >> a >> b >> k;\n while (k--) {\n cin >> ta >> fa >> tb >> fb;\n long long ans = abs(ta - tb);\n if (ans != 0) {\n if (fa > b || fa < a) {\n ans += min(abs(fa - a) + abs(fb - a), abs(fa - b) + abs(fb - b));\n } else if (fb > b || fb < a) {\n ans += min(abs(fb - b) + abs(fa - b), abs(fb - a) + abs(fa - a));\n } else {\n ans += abs(fa - fb);\n }\n } else {\n ans += abs(fa - fb);\n }\n cout << ans << '\\n';\n }\n}","item":{"problem_id":"1020A","pseudocode":"MAXN = constant long long integer = 200100, md = constant long long integer of size 998244353\ndefine the main function\n n, h, a, b, k, ta, fa, tb, fb = long longs\n read n, h, a, b, k\n while looping decrease k by 1\n read ta, fa, tb, fb\n ans = long long = the absolute value of the result of ta - tb\n if ans is not zero\n if fa > b or fa < a\n ans = ans + the lower value between the absolute value of the result of fa - a + the absolute value of the result of fb - a, and the absolute value of the result of fa - b + the absolute value of the result of fb - b\n else if fb > b or fb < a\n ans = ans + the lower value between the absolute value of the result of fb - b + the absolute value of the result of fa - b, and the absolute value of the result of fb - a + the absolute value of the result of fa - a\n else\n ans = ans + the absolute value of the result of fa - fb\n end of the block\n else\n ans = ans + the absolute value of the result of fa - fb\n end of the block\n print ans\n end of the block\nend of the block","testcases":[[["3 6 2 3 3","1 2 1 3","1 4 3 4","1 2 2 3"],["1","4","2"]],[["1 1 1 1 1","1 1 1 1"],["0"]],[["100000000 100000000 100000000 100000000 1","100000000 100000000 100000000 1"],["99999999"]],[["100000000 100000000 77777777 99999999 12","52734045 43343967 91011672 73768545","21790053 90211597 67340762 8250031","24044899 62998793 6713109 57209480","89691587 81568441 19189392 6826234","70013637 30045812 52909796 80677960","33399549 84055048 68500031 3988584","45704401 52047669 50628834 62126725","39766526 17191727 81768099 6502269","41352724 60903968 58736236 29890915","70386933 20446371 26841274 59582206","46199386 97177418 57843999 82216777","38707022 61698842 84371648 2229489"],["76720669","127512275","52679071","145244402","67735989","115166946","46305593","173863131","82144183","119072636","26605254","137291849"]],[["100 100 1 3 20","74 1 91 1","47 1 61 2","66 1 61 3","53 1 37 4","21 1 84 5","55 1 32 6","77 1 88 7","28 1 89 8","35 1 26 9","69 1 69 10","26 1 96 11","58 1 4 12","95 1 61 13","81 1 36 14","23 1 1 15","80 1 16 16","79 1 65 17","39 1 47 18","34 1 61 19","80 1 4 20"],["17","15","7","19","67","28","17","68","17","9","80","65","46","58","36","79","30","25","45","95"]],[["100000000 100000000 2 100000000 12","2612471 48868162 29162850 57692091","31688767 62108610 77923010 74959754","57830095 15800895 92114075 93061963","62035859 76169684 7612540 87883657","55511003 83853726 73866134 72765460","54005466 12336701 37168447 28894079","41264938 37703000 11542387 65303713","66391367 17156118 54008910 90201877","58409999 7098277 61550995 91167674","35190088 8520630 81755944 8804147","53620506 77917183 28972696 3791463","54388113 53543352 4298639 71716098"],["35374308","59085387","111545048","66137292","29443397","33394397","57323264","85428216","87210393","46849373","98773530","68262220"]],[["100000000 100000000 79143325 79143327 12","74006099 28600551 24880332 68336589","69329301 42934730 16307562 83475068","46167121 21314785 56843793 59620581","41613540 70252092 59230571 13546098","96139233 56045887 56357011 54406687","83908495 58114850 10861467 89520384","29113449 27916144 92325640 57036985","10798748 8319880 32159825 42608900","54301068 29037600 5582179 17525039","15921999 16692413 85656864 40132507","60042800 50303035 55023067 86876222","15385390 30501451 53879005 25765922"],["110475277","93562077","88027956","92105491","87616298","104452562","136545712","128718947","160442900","171196595","41592920","140512892"]],[["3 10 7 9 10","3 2 3 9","1 9 3 1","2 2 3 8","1 2 2 5","2 6 2 8","2 7 2 8","3 5 3 8","2 6 2 5","2 7 3 2","1 9 3 8"],["7","10","7","8","2","1","3","1","6","3"]],[["6 15 12 15 10","2 2 6 12","1 8 2 2","1 3 4 6","3 2 5 1","4 10 6 15","5 8 6 15","3 4 4 13","1 7 2 10","1 1 4 13","1 2 5 13"],["14","15","18","23","7","8","10","8","15","15"]],[["6 15 1 14 10","2 7 5 6","2 4 6 2","5 2 6 5","1 14 6 5","2 2 4 13","2 7 6 13","6 9 6 10","3 8 4 12","2 10 6 4","2 10 6 15"],["4","6","4","14","13","10","1","5","10","9"]]]}} +{"instance_id":"pseudo_to_code_0.5k_41","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n = integer\n read n\n s = string\n read s\n sort string s\n print s\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n string s;\n cin >> s;\n sort(s.begin(), s.end());\n cout << s << endl;\n}","item":{"problem_id":"1063A","pseudocode":"define the main function\n n = integer\n read n\n s = string\n read s\n sort string s\n print s\nend of the block","testcases":[[["5","oolol"],["llooo"]],[["16","gagadbcgghhchbdf"],["aabbccddfgggghhh"]],[["1","z"],["z"]],[["2","az"],["az"]],[["2","aa"],["aa"]],[["15","abacabadabacaba"],["aaaaaaaabbbbccd"]],[["21","arozaupalanalapuazora"],["aaaaaaaallnoopprruuzz"]],[["9","abcabcabc"],["aaabbbccc"]],[["10","msunonames"],["aemmnnossu"]],[["4","mems"],["emms"]],[["6","msucmc"],["ccmmsu"]],[["7","lolikek"],["eikkllo"]]]}} +{"instance_id":"pseudo_to_code_0.5k_42","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n counter, k =integers with counter = 1, k = 0\n s, s1 = strings\n Read s1, s2\n c = character, set to s1[k]\n for x = 0 to length of string s2 exclusive\n if c is s2[x]\n increment counter\n set c to s1[++k]\n end of the block\n print counter and a new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int counter = 1, k = 0;\n string s1, s2;\n cin >> s1 >> s2;\n char c = s1[k];\n for (int x = 0; x < s2.length(); x++)\n if (c == s2[x]) {\n counter++;\n c = s1[++k];\n }\n cout << counter << endl;\n return 0;\n}","item":{"problem_id":"265A","pseudocode":"define the main function\n counter, k =integers with counter = 1, k = 0\n s, s1 = strings\n Read s1, s2\n c = character, set to s1[k]\n for x = 0 to length of string s2 exclusive\n if c is s2[x]\n increment counter\n set c to s1[++k]\n end of the block\n print counter and a new line\n return to indicate successful execution\nend of the block","testcases":[[["RGB","RRR"],["2"]],[["RRRBGBRBBB","BBBRR"],["3"]],[["BRRBGBRGRBGRGRRGGBGBGBRGBRGRGGGRBRRRBRBBBGRRRGGBBB","BBRBGGRGRGBBBRBGRBRBBBBRBRRRBGBBGBBRRBBGGRBRRBRGRB"],["15"]],[["G","RRBBRBRRBR"],["1"]],[["RRRRRBRRBRRGRBGGRRRGRBBRBBBBBRGRBGBRRGBBBRBBGBRGBB","B"],["1"]],[["RRGGBRGRBG","BRRGGBBGGR"],["7"]],[["BBRRGBGGRGBRGBRBRBGR","GGGRBGGGBRRRRGRBGBGRGRRBGRBGBG"],["15"]],[["GBRRBGBGBBBBRRRGBGRRRGBGBBBRGR","RRGBRRGRBBBBBBGRRBBR"],["8"]],[["BRGRRGRGRRGBBGBBBRRBBRRBGBBGRGBBGGRGBRBGGGRRRBGGBB","RGBBGRRBBBRRGRRBRBBRGBBGGGRGBGRRRRBRBGGBRBGGGRGBRR"],["16"]],[["GGRGGBRRGRGBRRGGRBBGGRRGBBBGBBBGGRBGGBRBBRGBRRRBRG","GGRGRRRRRRRRRGBBBBRGBRGRGRRGBBRGGBRBBRBGBRGRRRRGGR"],["18"]],[["RBBRBGBBGGGBRRBGBRGRRGGRBBBBGRBGGBRRBGBBRBRGBBGGGG","BRRGRBGRBGBRGBRBGGBBBGBBRGRBGRGRBGRBGGRRBGBRGRRBBG"],["23"]],[["RRGGRRBRGRGBRGBRGBBRGGGBRBGBRGBRGGBRBRGBGRRBBGGRBR","BRGRBBBGRBGRRGGRRRRRRRRGGGGGGGGBGGGGGGGRGRBBRGRGBR"],["14"]],[["RBRBRRRRRGGR","BBBBRRGGBGRBRGBBRGGGRGGBRRBRBRBGGG"],["12"]],[["GGRGGGBRGRGRBBRGGGRBGRRR","GBBBBGBGBGBBBRGGRGGBGRRGRRRGBGB"],["12"]],[["RGRBGBRBBGBRRGGGBBGBRRBGRGBBBBBGRRRGGRBB","BGR"],["2"]],[["R","B"],["1"]],[["RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"],["50"]],[["RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG"],["1"]],[["R","GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_43","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n x=int\n read x\n if x is 1\n print -1\n else\n print x, space, x\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int x;\n cin >> x;\n if (x == 1)\n puts(\"-1\");\n else\n cout << x << \" \" << x << endl;\n return 0;\n}","item":{"problem_id":"1088A","pseudocode":"define the main function\n x=int\n read x\n if x is 1\n print -1\n else\n print x, space, x\n return to indicate successful execution\nend of the block","testcases":[[["10"],["10 10"]],[["1"],["-1"]],[["5"],["5 5"]],[["8"],["8 8"]],[["20"],["20 20"]],[["55"],["55 55"]],[["78"],["78 78"]],[["89"],["89 89"]],[["100"],["100 100"]],[["2"],["2 2"]],[["3"],["3 3"]],[["4"],["4 4"]],[["6"],["6 6"]],[["7"],["7 7"]],[["9"],["9 9"]],[["11"],["11 11"]],[["12"],["12 12"]],[["13"],["13 13"]],[["14"],["14 14"]],[["15"],["15 15"]],[["16"],["16 16"]],[["17"],["17 17"]],[["18"],["18 18"]],[["19"],["19 19"]],[["21"],["21 21"]],[["22"],["22 22"]],[["23"],["23 23"]],[["24"],["24 24"]],[["25"],["25 25"]],[["26"],["26 26"]],[["27"],["27 27"]],[["28"],["28 28"]],[["29"],["29 29"]],[["30"],["30 30"]],[["31"],["31 31"]],[["32"],["32 32"]],[["33"],["33 33"]],[["34"],["34 34"]],[["35"],["35 35"]],[["36"],["36 36"]],[["37"],["37 37"]],[["38"],["38 38"]],[["39"],["39 39"]],[["40"],["40 40"]],[["41"],["41 41"]],[["42"],["42 42"]],[["43"],["43 43"]],[["44"],["44 44"]],[["45"],["45 45"]],[["46"],["46 46"]],[["47"],["47 47"]],[["48"],["48 48"]],[["49"],["49 49"]],[["50"],["50 50"]],[["51"],["51 51"]],[["52"],["52 52"]],[["53"],["53 53"]],[["54"],["54 54"]],[["56"],["56 56"]],[["57"],["57 57"]],[["58"],["58 58"]],[["59"],["59 59"]],[["60"],["60 60"]],[["61"],["61 61"]],[["62"],["62 62"]],[["63"],["63 63"]],[["64"],["64 64"]],[["65"],["65 65"]],[["66"],["66 66"]],[["67"],["67 67"]],[["68"],["68 68"]],[["69"],["69 69"]],[["70"],["70 70"]],[["71"],["71 71"]],[["72"],["72 72"]],[["73"],["73 73"]],[["74"],["74 74"]],[["75"],["75 75"]],[["76"],["76 76"]],[["77"],["77 77"]],[["79"],["79 79"]],[["80"],["80 80"]],[["81"],["81 81"]],[["82"],["82 82"]],[["83"],["83 83"]],[["84"],["84 84"]],[["85"],["85 85"]],[["86"],["86 86"]],[["87"],["87 87"]],[["88"],["88 88"]],[["90"],["90 90"]],[["91"],["91 91"]],[["92"],["92 92"]],[["93"],["93 93"]],[["94"],["94 94"]],[["95"],["95 95"]],[["96"],["96 96"]],[["97"],["97 97"]],[["98"],["98 98"]],[["99"],["99 99"]]]}} +{"instance_id":"pseudo_to_code_0.5k_44","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integer n\n read n\n declare set words containing long longs\n for i = 0 to n exlcusive\n declare string s\n read s\n define vector b with length of 26\n for j = 0 to s size exclusive do set b[s[j] - 'a'] to true\n define long long hash = 0, p = 1\n for int j = 0; j less than 26; increment j, p <<= 1 do add b[j] * p to hash\n insert hash into words\n end of the block\n print words size\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n set words;\n for (int i = 0; i < n; i++) {\n string s;\n cin >> s;\n vector b(26);\n for (int j = 0; j < s.size(); j++) b[s[j] - 'a'] = true;\n long long hash = 0, p = 1;\n for (int j = 0; j < 26; j++, p <<= 1) hash += b[j] * p;\n words.insert(hash);\n }\n cout << words.size() << endl;\n return 0;\n}","item":{"problem_id":"975A","pseudocode":"define the main function\n declare integer n\n read n\n declare set words containing long longs\n for i = 0 to n exlcusive\n declare string s\n read s\n define vector b with length of 26\n for j = 0 to s size exclusive do set b[s[j] - 'a'] to true\n define long long hash = 0, p = 1\n for int j = 0; j less than 26; increment j, p <<= 1 do add b[j] * p to hash\n insert hash into words\n end of the block\n print words size\n return to indicate successful execution\nend of the block","testcases":[[["5","a aa aaa ab abb"],["2"]],[["3","amer arem mrea"],["1"]],[["10","bda bbb cda dca dda dcb bcd dcb ada ddd"],["6"]],[["2","fhjlqs aceginpr"],["2"]],[["2","bcdfghimn efghijlmo"],["2"]],[["40","bebrmhdoznhakjudoi hylc hnzkxxfooufuno bkvj rkozimhcmzadr omsc ajcelmhtk mjnchbkqrbuz ihydermwbrsgytxfzdcylehjx vegkxvau tp lmutlyxkqaysxuji cjcjjkmgiwvwnexwmwi qmmkjt bdste vrnoxebytx jjtskzvmmytxdusg txhghrzuodnzy dtqtrswcmgocuchytpakxpjd juiwqvkownswa vmkkuhqvuhxjbyb dso peiobraqrzwvs lel ydvihlv ejnhbrscrgkacdewbfblw whcbauuluaruezarohdberlx kprstnxfwe b jjpytihgx hllwpib rcekilxlsdqpqzrxnuucasu kygmoteelkbe gafnns ufke acofjdfute igdokgbriwypes xqywkouwsyenolxkt azbbywqizyztqjqup ell"],["39"]],[["20","a a a a a a a a a a a a a a a a a a a a"],["1"]],[["20","bc bcb aa aa b c bc acc c a cac aac cc cb c cca c c aa c"],["5"]],[["50","ecceieicc icicceic eieciceei eeeiceeie iiiiec eeciciceii iiceieeei ieecc iceeeeeici eiecei ecceii ccciicciee cieieeeee ieeccie iccieice eccciiciii cicii eiiee eieeiec cccecc eiiec eeeiiceeic eececicce eieeiie ciccei iceiecccci ceicieeece iieiiiic ceeeiic icciee cceeeicic icceieeci eeiiici iceieciccc cceee ciceceic eccieccii ceciiceecc iieeicccc eciiiiie iieiceeec ccecc eieciecc iiiic ciiei eeiiic eiccic cciieii eccic ecceeieeci"],["4"]],[["50","eebabaeegaab febcadgedaf fdfdgdcgcaa ffgdegadcgb cagacdfddeg eefaadccdag gadcddedcec adfgdaebgffg faadbcaefcaf ccecebffagf fdddbddddfeb fgdeefcafe bcgfbeddagd dacdbdagdbe bbcbbcddbb bcdafagdfgfg dfdegcdaefc dcdffegacb bdbdebgcfdfg egdbeebdacgg fabcgbcgddbf bdfecgaaefa fccabcaaaace geegbeegcagf bdagfdagfa eacffgfdfbad feebdfdbceca bbddbccfacea dbbeedgggeeb dcbegegdfe fadbdbfceee dcbgcdccffca egfeffdcgfc gbgeaagcdg debfaagefg ggadbaefeef gcebggbgcdae bggdbdgcdadg efefebeaebb gggbbaecfg fbfbffcfeceb fcaebecfdgb fdaaecgecdfb eaagfebcda cffffdabga fgbgbeggba aebcabdaff cccgcbgdeba agcefgceccce afgabdebee"],["22"]]]}} +{"instance_id":"pseudo_to_code_0.5k_45","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create ints p and n\n read p and n\n create vector of ints a with p elements\n loop i from 1 to n inclusive\n declare int val\n read input to val\n declare int variable mod = val modulo p\n if a[mod] is not 0\n print i\n return to indicate successful execution\n end of the block\n increment a[mod]\n end of the block\n print -1\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int p, n;\n cin >> p >> n;\n vector a(p);\n for (int i = 1; i <= n; i++) {\n int val;\n cin >> val;\n int mod = val % p;\n if (a[mod]) {\n cout << i << endl;\n return 0;\n }\n a[mod]++;\n }\n cout << -1 << endl;\n return 0;\n}","item":{"problem_id":"447A","pseudocode":"define the main function\n create ints p and n\n read p and n\n create vector of ints a with p elements\n loop i from 1 to n inclusive\n declare int val\n read input to val\n declare int variable mod = val modulo p\n if a[mod] is not 0\n print i\n return to indicate successful execution\n end of the block\n increment a[mod]\n end of the block\n print -1\n return to indicate successful execution\nend of the block","testcases":[[["10 5","0","21","53","41","53"],["4"]],[["5 5","0","1","2","3","4"],["-1"]],[["10 6","811966798","734823552","790326404","929189974","414343256","560346537"],["4"]],[["2 2","788371161","801743052"],["-1"]],[["10 6","812796223","122860157","199259103","597650585","447742024","521549402"],["3"]],[["300 2","822454942","119374431"],["-1"]],[["300 2","823284367","507345500"],["-1"]],[["2 5","791579811","35613889","997079893","878677665","693717467"],["2"]],[["20 5","793926268","28931770","842870287","974950617","859404206"],["-1"]],[["100 15","805069249","778178198","633897389","844316223","146759898","870527016","82668754","42060733","943602929","979451110","746979598","47406033","607284062","850870259","229415316"],["5"]],[["100 15","806204335","189490323","718805086","716787474","262315718","822030596","894644222","724054623","141384399","579354205","192622443","672556242","97417563","243354557","208957882"],["8"]],[["100 15","807033760","577461392","275221433","532633429","295714486","783298996","255799943","99107143","729119412","59302896","37640015","313610861","630550567","534283052","681062462"],["8"]],[["100 15","808103310","136224397","360129131","405104681","263786657","734802577","67808179","928584682","926900882","511722343","483348395","938695534","120684068","74152694","808088675"],["9"]],[["2 2","2","2"],["2"]],[["300 2","0","300"],["2"]],[["2 2","0","0"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_46","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n = int\n read n\n name, crew = string\n rat, woch, men, cap = string vector\n for i = 0 to n\n read name then crew\n if crew is \"rat\"\n append name to rat\n else if crew is \"woman\" or \"child\"\n append name to woch\n else if crew is \"man\"\n append name to men\n else if crew is \"captain\"\n append name to cap\n end of the block\n print first size of rat values of rat\n print first size of woch values of woch\n print first size of men values of men\n print first size of cap values of cap\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n string name, crew;\n vector rat, woch, men, cap;\n for (int i = 0; i < n; i++) {\n cin >> name >> crew;\n if (crew == \"rat\")\n rat.push_back(name);\n else if (crew == \"woman\" || crew == \"child\")\n woch.push_back(name);\n else if (crew == \"man\")\n men.push_back(name);\n else if (crew == \"captain\")\n cap.push_back(name);\n }\n for (int i = 0; i < rat.size(); i++) { cout << rat[i] << endl; }\n for (int i = 0; i < woch.size(); i++) { cout << woch[i] << endl; }\n for (int i = 0; i < men.size(); i++) { cout << men[i] << endl; }\n for (int i = 0; i < cap.size(); i++) { cout << cap[i] << endl; }\n return 0;\n}","item":{"problem_id":"63A","pseudocode":"define the main function\n n = int\n read n\n name, crew = string\n rat, woch, men, cap = string vector\n for i = 0 to n\n read name then crew\n if crew is \"rat\"\n append name to rat\n else if crew is \"woman\" or \"child\"\n append name to woch\n else if crew is \"man\"\n append name to men\n else if crew is \"captain\"\n append name to cap\n end of the block\n print first size of rat values of rat\n print first size of woch values of woch\n print first size of men values of men\n print first size of cap values of cap\n return to indicate successful execution\nend of the block","testcases":[[["6","Jack captain","Alice woman","Charlie man","Teddy rat","Bob child","Julia woman"],["Teddy","Alice","Bob","Julia","Charlie","Jack"]],[["1","A captain"],["A"]],[["1","Abcdefjhij captain"],["Abcdefjhij"]],[["5","A captain","B man","D woman","C child","E rat"],["E","D","C","B","A"]],[["10","Cap captain","D child","C woman","A woman","E child","Man man","B child","F woman","Rat rat","Ratt rat"],["Rat","Ratt","D","C","A","E","B","F","Man","Cap"]],[["5","Joyxnkypf captain","Dxssgr woman","Keojmnpd rat","Gdv man","Hnw man"],["Keojmnpd","Dxssgr","Gdv","Hnw","Joyxnkypf"]],[["11","Jue rat","Wyglbyphk rat","Gjlgu child","Gi man","Attx rat","Theorpkgx man","Ym rat","X child","B captain","Enualf rat","Kktsgyuyv woman"],["Jue","Wyglbyphk","Attx","Ym","Enualf","Gjlgu","X","Kktsgyuyv","Gi","Theorpkgx","B"]],[["22","Wswwcvvm woman","Btmfats rat","I rat","Ocmtsnwx man","Urcqv rat","Yghnogt woman","Wtyfc man","Wqle child","Ujfrelpu rat","Dstixj man","Ahksnio woman","Khkvaap woman","Sjppvwm rat","Egdmsv rat","Dank rat","Nquicjnw rat","Lh captain","Tdyaqaqln rat","Qtj rat","Tfgwijvq rat","Nbiso child","Nqthvbf woman"],["Btmfats","I","Urcqv","Ujfrelpu","Sjppvwm","Egdmsv","Dank","Nquicjnw","Tdyaqaqln","Qtj","Tfgwijvq","Wswwcvvm","Yghnogt","Wqle","Ahksnio","Khkvaap","Nbiso","Nqthvbf","Ocmtsnwx","Wtyfc","Dstixj","Lh"]],[["36","Kqxmtwmsf child","Ize woman","Dlpr child","K woman","F captain","Rjwfeuhba rat","Bbv rat","S rat","Mnmg woman","Smzyx woman","Sr man","Qmhroracn rat","Soqpuqock rat","Pibdq man","Ilrkrptx rat","Zaecfyqka man","Mmersfs child","Vvvocqi man","Hjeqxvq rat","Mpmb woman","Wmgu woman","Cerelmhoxi child","A man","Dylv man","Xrdgmmtcpq woman","Xj woman","Ceh child","Ofccguo man","Nevr man","Aknkwdkq child","Bmo man","Lqo woman","Vej child","T child","Rlijc man","Nsdtpdg woman"],["Rjwfeuhba","Bbv","S","Qmhroracn","Soqpuqock","Ilrkrptx","Hjeqxvq","Kqxmtwmsf","Ize","Dlpr","K","Mnmg","Smzyx","Mmersfs","Mpmb","Wmgu","Cerelmhoxi","Xrdgmmtcpq","Xj","Ceh","Aknkwdkq","Lqo","Vej","T","Nsdtpdg","Sr","Pibdq","Zaecfyqka","Vvvocqi","A","Dylv","Ofccguo","Nevr","Bmo","Rlijc","F"]],[["2","A captain","B man"],["B","A"]],[["2","B woman","A captain"],["B","A"]],[["2","X child","Y captain"],["X","Y"]],[["2","X captain","Y rat"],["Y","X"]],[["6","Abdelrhman captain","Alice woman","Charlie man","Teddy rat","Bob child","Julia woman"],["Teddy","Alice","Bob","Julia","Charlie","Abdelrhman"]],[["4","Aratos captain","Mind child","Aman woman","Carrot man"],["Mind","Aman","Carrot","Aratos"]]]}} +{"instance_id":"pseudo_to_code_0.5k_47","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integers a, b, c and k and an integer array d with 6 elements\n read input to a, b and c\n change d[0] to a + b + c\n change d[1] to a + b * c\n change d[2] to a * b * c\n change d[3] to a * b + c\n change d[4] to (a + b) * c\n change d[5] to a * (b + c)\n for integer i = 0 to 6 exclusive\n for integer j = 5 to i exclusive counting down\n if d[j - 1] is greater than d[j]\n set k to d[j - 1]\n assign d[j] to d[j - 1]\n assign k to d[j]\n end of the block\n end of the block\n end of the block\n print d[5]\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int a, b, c, d[6], k;\n cin >> a >> b >> c;\n d[0] = a + b + c;\n d[1] = a + b * c;\n d[2] = a * b * c;\n d[3] = a * b + c;\n d[4] = (a + b) * c;\n d[5] = a * (b + c);\n for (int i = 0; i < 6; i++) {\n for (int j = 5; j > i; j--) {\n if (d[j - 1] > d[j]) {\n k = d[j - 1];\n d[j - 1] = d[j];\n d[j] = k;\n }\n }\n }\n cout << d[5] << endl;\n}","item":{"problem_id":"479A","pseudocode":"define the main function\n declare integers a, b, c and k and an integer array d with 6 elements\n read input to a, b and c\n change d[0] to a + b + c\n change d[1] to a + b * c\n change d[2] to a * b * c\n change d[3] to a * b + c\n change d[4] to (a + b) * c\n change d[5] to a * (b + c)\n for integer i = 0 to 6 exclusive\n for integer j = 5 to i exclusive counting down\n if d[j - 1] is greater than d[j]\n set k to d[j - 1]\n assign d[j] to d[j - 1]\n assign k to d[j]\n end of the block\n end of the block\n end of the block\n print d[5]\nend of the block","testcases":[[["1","2","3"],["9"]],[["2","10","3"],["60"]],[["1","1","1"],["3"]],[["1","2","1"],["4"]],[["10","10","10"],["1000"]],[["5","1","3"],["20"]],[["3","1","5"],["20"]],[["6","7","1"],["48"]],[["1","8","3"],["27"]],[["9","7","2"],["126"]],[["1","1","10"],["20"]],[["9","1","1"],["18"]],[["10","5","6"],["300"]],[["8","9","7"],["504"]],[["4","2","10"],["80"]],[["2","8","3"],["48"]],[["3","5","7"],["105"]],[["1","10","1"],["12"]],[["2","2","2"],["8"]],[["5","6","1"],["35"]],[["10","1","1"],["20"]],[["1","6","1"],["8"]],[["1","9","1"],["11"]],[["2","1","2"],["6"]],[["2","6","1"],["14"]],[["9","2","1"],["27"]],[["1","9","2"],["20"]],[["1","3","1"],["5"]],[["2","1","1"],["4"]]]}} +{"instance_id":"pseudo_to_code_0.5k_48","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n x, y = string\n S,Y= string\n read s and y\n set S = string(y.size(), '0') + s\n Y = string(s.size(), '0') + y\n if Y > S\n print <\n else if S > Y\n print >\n else do the following\n print =\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string s, y;\n string S, Y;\n cin >> s >> y;\n S = string(y.size(), '0') + s;\n Y = string(s.size(), '0') + y;\n if (Y > S)\n cout << \"<\" << endl;\n else if (S > Y)\n cout << \">\" << endl;\n else {\n cout << \"=\" << endl;\n }\n return 0;\n}","item":{"problem_id":"616A","pseudocode":"define the main function\n x, y = string\n S,Y= string\n read s and y\n set S = string(y.size(), '0') + s\n Y = string(s.size(), '0') + y\n if Y > S\n print <\n else if S > Y\n print >\n else do the following\n print =\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["9","10"],["<"]],[["11","10"],[">"]],[["00012345","12345"],["="]],[["0123","9"],[">"]],[["0123","111"],[">"]],[["9","9"],["="]],[["0","0000"],["="]],[["1213121","1213121"],["="]],[["8631749422082281871941140403034638286979613893271246118706788645620907151504874585597378422393911017","1460175633701201615285047975806206470993708143873675499262156511814213451040881275819636625899967479"],[">"]],[["6421902501252475186372406731932548506197390793597574544727433297197476846519276598727359617092494798","8"],[">"]],[["9","3549746075165939381145061479392284958612916596558639332310874529760172204736013341477640605383578772"],["<"]],[["11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111","11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"],["="]],[["0000000001","2"],["<"]],[["1000000000000000000000000000000000","1000000000000000000000000000000001"],["<"]],[["123456123456123456123456123456123456123456123456123456123456123456","123456123456123456123456123456123456123456123456123456123456123456123456123456"],["<"]],[["1111111111111111111111111111111111111111","2222222222222222222222222222222222222222"],["<"]],[["123456789999999","123456789999999"],["="]],[["111111111111111111111111111111","222222222222222222222222222222"],["<"]],[["1111111111111111111111111111111111111111111111111111111111111111111111","1111111111111111111111111111111111111111111111111111111111111111111111"],["="]],[["587345873489573457357834","47957438573458347574375348"],["<"]],[["1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111","33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333"],["<"]],[["11111111111111111111111111111111111","44444444444444444444444444444444444"],["<"]],[["11111111111111111111111111111111111","22222222222222222222222222222222222"],["<"]],[["9999999999999999999999999999999999999999999999999999999999999999999","99999999999999999999999999999999999999999999999999999999999999999999999999999999999999"],["<"]],[["1","2"],["<"]],[["9","0"],[">"]],[["222222222222222222222222222222222222222222222222222222222","22222222222222222222222222222222222222222222222222222222222"],["<"]],[["66646464222222222222222222222222222222222222222222222222222222222222222","111111111111111111111111111111111111111111111111111111111111111111111111111111111111"],["<"]],[["222222222222222222222222222222222222222222222222222","111111111111111111111111111111111111111111111111111111111111111"],["<"]],[["11111111111111111111111111111111111111","44444444444444444444444444444444444444"],["<"]],[["01","2"],["<"]],[["00","01"],["<"]],[["99999999999999999999999999999999999999999999999","99999999999999999999999999999999999999999999999"],["="]],[["43278947323248843213443272432","793439250984509434324323453435435"],["<"]],[["0","1"],["<"]],[["010","011"],["<"]],[["999999999999999999999999999999999999999999999999","999999999999999999999999999999999999999999999999"],["="]],[["0001001","0001010"],["<"]],[["1111111111111111111111111111111111111111111111111111111111111","1111111111111111111111111111111111111111111111111111111111111"],["="]],[["00000","00"],["="]],[["999999999999999999999999999","999999999999999999999999999"],["="]],[["999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999","999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999"],["="]],[["001","000000000010"],["<"]],[["01","10"],["<"]],[["555555555555555555555555555555555555555555555555555555555555","555555555555555555555555555555555555555555555555555555555555"],["="]],[["5555555555555555555555555555555555555555555555555","5555555555555555555555555555555555555555555555555"],["="]],[["01","02"],["<"]],[["001111","0001111"],["="]],[["55555555555555555555555555555555555555555555555555","55555555555555555555555555555555555555555555555555"],["="]],[["1029301293019283091283091283091280391283","1029301293019283091283091283091280391283"],["="]],[["001","2"],["<"]],[["000000000","000000000"],["="]],[["000000","10"],["<"]],[["000000000000000","001"],["<"]],[["0000001","2"],["<"]],[["0000","123"],["<"]],[["951","960"],["<"]],[["002","0001"],[">"]],[["0000001","01"],["="]],[["99999999999999999999999999999999999999999999999999999999999999","99999999999999999999999999999999999999999999999999999999999999"],["="]],[["12345678901234567890123456789012345678901234567890123456789012","12345678901234567890123456789012345678901234567890123456789012"],["="]],[["02","01"],[">"]],[["00000111111","00000110111"],[">"]],[["0123","123"],["="]],[["123771237912798378912","91239712798379812897389123123123123"],["<"]],[["00001","002"],["<"]],[["0000000000000000000000000000000000000000000000000000000000000","000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"],["="]],[["000000001","00002"],["<"]],[["00002","00003"],["<"]],[["000123456","123457"],["<"]],[["01","00"],[">"]],[["00","0"],["="]],[["10","11"],["<"]],[["0011","12"],["<"]],[["00","1"],["<"]],[["0","0"],["="]],[["00","10"],["<"]],[["011","10"],[">"]],[["00011111111111111111111111111111111111000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000011000","11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112091"],["<"]],[["0000001","00"],[">"]],[["01","1"],["="]],[["010","001"],[">"]],[["100","111"],["<"]],[["1","0"],[">"]],[["000000","000000000000000000000"],["="]],[["010101","010101"],["="]],[["00000000000000000001111111111111111111111111111111111111111111111111111111","11111111111111111111111"],[">"]],[["0000000","0"],["="]],[["187923712738712879387912839182381","871279397127389781927389718923789178923897123"],["<"]],[["0010","030"],["<"]]]}} +{"instance_id":"pseudo_to_code_0.5k_49","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, m =integers\n Read n, m\n flag = integer with 0\n for i = 0 to n exclusive\n for j = 0 to m exclusive\n x = character\n Read x\n if x is equal to C OR x is equal to M OR x is equal to Y, set flag to 1\n end of the block\n end of the block\n if flag is equal to 1\n print #Color and a new line\n else do the following\n print #Black&White and a new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, m;\n cin >> n >> m;\n int flag = 0;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n char x;\n cin >> x;\n if (x == 'C' || x == 'M' || x == 'Y') flag = 1;\n }\n }\n if (flag == 1)\n cout << \"#Color\" << endl;\n else\n cout << \"#Black&White\" << endl;\n return 0;\n}","item":{"problem_id":"707A","pseudocode":"define the main function\n n, m =integers\n Read n, m\n flag = integer with 0\n for i = 0 to n exclusive\n for j = 0 to m exclusive\n x = character\n Read x\n if x is equal to C OR x is equal to M OR x is equal to Y, set flag to 1\n end of the block\n end of the block\n if flag is equal to 1\n print #Color and a new line\n else do the following\n print #Black&White and a new line\n return to indicate successful execution\nend of the block","testcases":[[["2 2","C M","Y Y"],["#Color"]],[["3 2","W W","W W","B B"],["#Black&White"]],[["1 1","W"],["#Black&White"]],[["2 3","W W W","B G Y"],["#Color"]],[["1 1","W"],["#Black&White"]],[["5 5","W G B Y M","G B Y M C","B Y M C W","Y M C W G","M C W G B"],["#Color"]],[["1 6","C M Y W G B"],["#Color"]],[["1 3","W G B"],["#Black&White"]],[["1 1","W"],["#Black&White"]],[["5 5","W G B W G","G B W G B","B W G B W","W G B W G","G B W G B"],["#Black&White"]],[["2 3","W W W","B G C"],["#Color"]],[["2 3","W W W","B G M"],["#Color"]],[["3 3","C B W","B Y M","B B W"],["#Color"]],[["1 3","W C W"],["#Color"]],[["3 3","B W B","B C W","B W W"],["#Color"]],[["1 2","W Y"],["#Color"]],[["1 1","G"],["#Black&White"]],[["1 3","B G W"],["#Black&White"]],[["2 2","W W","B C"],["#Color"]],[["1 1","M"],["#Color"]],[["1 2","W C"],["#Color"]],[["2 3","W W M","W W M"],["#Color"]],[["3 2","W W","W W","B C"],["#Color"]],[["2 3","W W C","W W W"],["#Color"]],[["1 3","G G G"],["#Black&White"]],[["1 1","C"],["#Color"]],[["1 2","C W"],["#Color"]],[["1 3","W W C"],["#Color"]],[["2 2","W B","B G"],["#Black&White"]],[["2 2","B B","Y Y"],["#Color"]],[["2 2","G G","C C"],["#Color"]],[["1 2","B C"],["#Color"]],[["1 4","G G G C"],["#Color"]],[["1 1","B"],["#Black&White"]],[["2 1","Y","B"],["#Color"]]]}} +{"instance_id":"pseudo_to_code_0.5k_50","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nfunction solve with unsigned long long argument x that returns unsigned long long\n new unsigned long longs ans, f, e and xx where ans = 0 and xx = x\n if x is less than 10, return x\n change e to x % 10\n while x != 0\n assign x modulo 10 to f\n divide x by 10\n end of the block\n if f <= e\n set ans to 9 + xx \/ 10\n else\n change ans to 8 + xx \/ 10\n return ans\nend of the block\ndefine the main function\n declare unsigned long longs a and b\n read input to a and b\n print solve(b) - solve(a - 1)\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"unsigned long long solve(unsigned long long x) {\n unsigned long long ans = 0, f, e, xx = x;\n if (x < 10) return x;\n e = x % 10;\n while (x) {\n f = x % 10;\n x \/= 10;\n }\n if (f <= e)\n ans = 9 + xx \/ 10;\n else\n ans = 8 + xx \/ 10;\n return ans;\n}\nint main() {\n unsigned long long a, b;\n cin >> a >> b;\n cout << solve(b) - solve(a - 1) << endl;\n return 0;\n}","item":{"problem_id":"204A","pseudocode":"function solve with unsigned long long argument x that returns unsigned long long\n new unsigned long longs ans, f, e and xx where ans = 0 and xx = x\n if x is less than 10, return x\n change e to x % 10\n while x != 0\n assign x modulo 10 to f\n divide x by 10\n end of the block\n if f <= e\n set ans to 9 + xx \/ 10\n else\n change ans to 8 + xx \/ 10\n return ans\nend of the block\ndefine the main function\n declare unsigned long longs a and b\n read input to a and b\n print solve(b) - solve(a - 1)\n return to indicate successful execution\nend of the block","testcases":[[["2 47"],["12"]],[["47 1024"],["98"]],[["1 1000"],["108"]],[["1 10000"],["1008"]],[["47 8545"],["849"]],[["1000 1000"],["0"]],[["47547 4587554587754542"],["458755458770699"]],[["1 1000000"],["100008"]],[["47 74"],["2"]],[["10001 10000002"],["999001"]],[["10000 100000"],["9000"]],[["458754 4588754"],["413001"]],[["111 111"],["1"]],[["110 147"],["4"]],[["1 1000000000"],["100000008"]],[["12 10000000000"],["999999998"]],[["1000000000 1000000000"],["0"]],[["1 1000000000000000000"],["100000000000000008"]],[["11 111111111111111100"],["11111111111111109"]],[["100000000000000000 1000000000000000000"],["90000000000000000"]],[["45481484484 848469844684844"],["84842436320036"]],[["975400104587000 48754000000000001"],["4777859989541300"]],[["11220451511 51511665251233335"],["5151165403078183"]],[["77 77"],["1"]],[["99 102"],["2"]],[["9997 87878000008"],["8787799002"]],[["10000000001 111111111111100001"],["11111110111110001"]],[["7777 88888"],["8112"]],[["999999999 10000000000"],["900000001"]],[["235 236"],["0"]],[["1 1"],["1"]],[["2 2"],["1"]],[["1 2"],["2"]],[["4 7"],["4"]],[["7 10"],["3"]],[["1 11"],["10"]],[["1 10"],["9"]],[["7 8"],["2"]],[["88 990"],["91"]],[["458985985498001244 985458425544874008"],["52647244004687276"]],[["115998725487587451 245744899758754501"],["12974617427116705"]],[["595754249475458004 615044544745124547"],["1929029526966655"]],[["9754875457700 1000000000000000000"],["99999024512454230"]],[["8758754570000 999999999999999999"],["99999124124543000"]],[["111111111111111111 333333333444444445"],["22222222233333334"]],[["822981258385599125 841978899930248528"],["1899764154464941"]],[["779547115376367013 980561039207670775"],["20101392383130376"]],[["335408916782916802 416495628489807285"],["8108671170689049"]],[["252509053898415172 285803555062529649"],["3329450116411448"]],[["919845424847912645 970651082117950285"],["5080565727003764"]],[["522842183413115088 853628713003942530"],["33078652959082744"]],[["84324827171274023 607953653548585226"],["52362882637731121"]],[["1312148742261681 277460340506883334"],["27614819176462166"]],[["645762257531682046 885295120956158518"],["23953286342447648"]],[["819875140559301752 946247219812473271"],["12637207925317152"]],[["4 19"],["7"]],[["5 45"],["9"]],[["9999999999999987 99999999999999711"],["8999999999999973"]],[["2 3"],["2"]],[["1827171 232817181719384635"],["23281718171755747"]],[["999999999999999999 1000000000000000000"],["1"]],[["73 678"],["61"]]]}} +{"instance_id":"pseudo_to_code_0.5k_51","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n = integer\n read n\n a = integer array of size n, b = integer array of size n\n for i = 0 to n exclusive, then read a[i]\n for i = 0 to n exclusive, then read b[i]\n maxi = integer = 0, p = integer = 0, q = integer = 0\n for l = 0 to n exclusive\n temp = integer = 0\n for r = l to n exclusive\n sum1 = integer = 0, sum2 = integer = 0\n for i = l to r inclusive\n sum1 = create a new number where if any position of a bit from sum1 or a[i] contains a 1 that new number in that same position contains a 1 in that bit location\n sum2 = create a new number where if any position of a bit from sum2 or b[i] contains a one that new number in that same position contains a 1 in that bit location\n end of the block\n sum = integer = sum1 + sum2\n if sum > maxi, then maxi = sum\n end of the block\n end of the block\n print maxi\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n int a[n], b[n];\n for (int i = 0; i < n; i++) { cin >> a[i]; }\n for (int i = 0; i < n; i++) { cin >> b[i]; }\n int maxi = 0, p = 0, q = 0;\n for (int l = 0; l < n; l++) {\n int temp = 0;\n for (int r = l; r < n; r++) {\n int sum1 = 0, sum2 = 0;\n for (int i = l; i <= r; i++) {\n sum1 |= a[i];\n sum2 |= b[i];\n }\n int sum = sum1 + sum2;\n if (sum > maxi) { maxi = sum; }\n }\n }\n cout << maxi << endl;\n return 0;\n}","item":{"problem_id":"631A","pseudocode":"define the main function\n n = integer\n read n\n a = integer array of size n, b = integer array of size n\n for i = 0 to n exclusive, then read a[i]\n for i = 0 to n exclusive, then read b[i]\n maxi = integer = 0, p = integer = 0, q = integer = 0\n for l = 0 to n exclusive\n temp = integer = 0\n for r = l to n exclusive\n sum1 = integer = 0, sum2 = integer = 0\n for i = l to r inclusive\n sum1 = create a new number where if any position of a bit from sum1 or a[i] contains a 1 that new number in that same position contains a 1 in that bit location\n sum2 = create a new number where if any position of a bit from sum2 or b[i] contains a one that new number in that same position contains a 1 in that bit location\n end of the block\n sum = integer = sum1 + sum2\n if sum > maxi, then maxi = sum\n end of the block\n end of the block\n print maxi\n return to indicate successful execution\nend of the block","testcases":[[["5","1 2 4 3 2","2 3 3 12 1"],["22"]],[["10","13 2 7 11 8 4 9 8 5 1","5 7 18 9 2 3 0 11 8 6"],["46"]],[["25","12 30 38 109 81 124 80 33 38 48 29 78 96 48 96 27 80 77 102 65 80 113 31 118 35","25 64 95 13 12 6 111 80 85 16 61 119 23 65 73 65 20 95 124 18 28 79 125 106 116"],["254"]],[["20","64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64","64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64"],["128"]],[["1","1000000000","1000000000"],["2000000000"]],[["1","0","0"],["0"]],[["2","7 16","16 7"],["46"]],[["4","6 0 0 0","0 0 0 1"],["7"]],[["8","1 2 4 8 16 32 64 128","1 2 4 8 16 32 64 128"],["510"]],[["1","2","3"],["5"]],[["1","4","3"],["7"]],[["1","1","1"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_52","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare int n\n read n\n declare int min1, max1, min2, max2, min3, max3\n read min1, max1\n read min2, max2\n read min3, max3\n if max1 + min2 + min3 is greater than or equal to n\n print n - min2 - min3, \" \", min2, \" \", min3\n else if max1 + max2 + min3 is greater than or equal to n\n print max1, \" \", n - max1 - min3, \" \", min3\n else\n max1, \" \", max2, \" \", n - max1 - max2\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n int min1, max1, min2, max2, min3, max3;\n cin >> min1 >> max1;\n cin >> min2 >> max2;\n cin >> min3 >> max3;\n if (max1 + min2 + min3 >= n)\n cout << n - min2 - min3 << \" \" << min2 << \" \" << min3 << \"\\n\";\n else if (max1 + max2 + min3 >= n)\n cout << max1 << \" \" << n - max1 - min3 << \" \" << min3 << \"\\n\";\n else\n cout << max1 << \" \" << max2 << \" \" << n - max1 - max2 << \"\\n\";\n return 0;\n}","item":{"problem_id":"557A","pseudocode":"define the main function\n declare int n\n read n\n declare int min1, max1, min2, max2, min3, max3\n read min1, max1\n read min2, max2\n read min3, max3\n if max1 + min2 + min3 is greater than or equal to n\n print n - min2 - min3, \" \", min2, \" \", min3\n else if max1 + max2 + min3 is greater than or equal to n\n print max1, \" \", n - max1 - min3, \" \", min3\n else\n max1, \" \", max2, \" \", n - max1 - max2\n return to indicate successful execution\nend of the block","testcases":[[["6","1 5","2 6","3 7"],["1 2 3"]],[["10","1 2","1 3","1 5"],["2 3 5"]],[["6","1 3","2 2","2 2"],["2 2 2"]],[["55","1 1000000","40 50","10 200"],["5 40 10"]],[["3","1 1","1 1","1 1"],["1 1 1"]],[["3","1 1000000","1 1000000","1 1000000"],["1 1 1"]],[["1000","100 400","300 500","400 1200"],["300 300 400"]],[["3000000","1 1000000","1 1000000","1 1000000"],["1000000 1000000 1000000"]],[["11","3 5","3 5","3 5"],["5 3 3"]],[["12","3 5","3 5","3 5"],["5 4 3"]],[["13","3 5","3 5","3 5"],["5 5 3"]],[["3000000","1000000 1000000","1000000 1000000","1000000 1000000"],["1000000 1000000 1000000"]],[["50","1 100","1 100","1 100"],["48 1 1"]],[["1279","123 670","237 614","846 923"],["196 237 846"]],[["1589","213 861","5 96","506 634"],["861 96 632"]],[["2115","987 987","112 483","437 959"],["987 483 645"]],[["641","251 960","34 370","149 149"],["458 34 149"]],[["1655","539 539","10 425","605 895"],["539 425 691"]],[["1477","210 336","410 837","448 878"],["336 693 448"]],[["1707","149 914","190 422","898 899"],["619 190 898"]],[["1529","515 515","563 869","169 451"],["515 845 169"]],[["1543","361 994","305 407","102 197"],["994 407 142"]],[["1107","471 849","360 741","71 473"],["676 360 71"]],[["1629279","267360 999930","183077 674527","202618 786988"],["999930 426731 202618"]],[["1233589","2850 555444","500608 921442","208610 607343"],["524371 500608 208610"]],[["679115","112687 183628","101770 982823","81226 781340"],["183628 414261 81226"]],[["1124641","117999 854291","770798 868290","76651 831405"],["277192 770798 76651"]],[["761655","88152 620061","60403 688549","79370 125321"],["620061 62224 79370"]],[["2174477","276494 476134","555283 954809","319941 935631"],["476134 954809 743534"]],[["1652707","201202 990776","34796 883866","162979 983308"],["990776 498952 162979"]],[["2065529","43217 891429","434379 952871","650231 855105"],["891429 523869 650231"]],[["1702543","405042 832833","50931 747750","381818 796831"],["832833 487892 381818"]],[["501107","19061 859924","126478 724552","224611 489718"],["150018 126478 224611"]],[["1629279","850831 967352","78593 463906","452094 885430"],["967352 209833 452094"]],[["1233589","2850 157021","535109 748096","392212 475634"],["157021 684356 392212"]],[["679115","125987 786267","70261 688983","178133 976789"],["430721 70261 178133"]],[["1124641","119407 734250","213706 860770","102149 102149"],["734250 288242 102149"]],[["761655","325539 325539","280794 792505","18540 106895"],["325539 417576 18540"]],[["2174477","352351 791072","365110 969163","887448 955610"],["791072 495957 887448"]],[["1652707","266774 638522","65688 235422","924898 992826"],["638522 89287 924898"]],[["2065529","608515 608515","751563 864337","614898 705451"],["608515 842116 614898"]],[["1702543","5784 996578","47395 300407","151614 710197"],["996578 300407 405558"]],[["501107","8073 390048","190494 647328","274071 376923"],["36542 190494 274071"]],[["200","50 50","100 100","50 50"],["50 100 50"]],[["14","1 100","1 100","8 9"],["5 1 8"]],[["300","200 400","50 100","40 80"],["210 50 40"]],[["10","3 6","3 6","3 6"],["4 3 3"]],[["14","3 6","3 6","3 6"],["6 5 3"]],[["17","3 6","3 6","3 6"],["6 6 5"]],[["1000000","300000 600000","300000 600000","300000 600000"],["400000 300000 300000"]],[["1400000","300000 600000","300000 600000","300000 600000"],["600000 500000 300000"]],[["1700000","300000 600000","300000 600000","300000 600000"],["600000 600000 500000"]],[["561","400 400","80 80","81 81"],["400 80 81"]],[["2000","100 1000","1 1","1 2000"],["1000 1 999"]],[["1000002","1 1000000","1 1000000","999999 1000000"],["2 1 999999"]],[["1000002","1 1000000","1 1000000","1000000 1000000"],["1 1 1000000"]]]}} +{"instance_id":"pseudo_to_code_0.5k_53","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create int k, l, m, n, d\n cont = 0\n read k, l, m, n, d\n set cont to d\n if at leat one of k, l, m or n =1\n print d\n else\n for i=1 to d inclusive\n if i mod k, i modl, i mod m and i mod n are different from 0, decrement cont\n end of the block\n print cont\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int k, l, m, n, d;\n int cont = 0;\n cin >> k >> l >> m >> n >> d;\n cont = d;\n if (k == 1 || l == 1 || m == 1 || n == 1) {\n cout << d << endl;\n } else {\n for (int i = 1; i <= d; i++) {\n if ((i % k != 0) && (i % l != 0) && (i % m != 0) && (i % n != 0)) cont--;\n }\n cout << cont << endl;\n }\n return 0;\n}","item":{"problem_id":"148A","pseudocode":"define the main function\n create int k, l, m, n, d\n cont = 0\n read k, l, m, n, d\n set cont to d\n if at leat one of k, l, m or n =1\n print d\n else\n for i=1 to d inclusive\n if i mod k, i modl, i mod m and i mod n are different from 0, decrement cont\n end of the block\n print cont\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["1","2","3","4","12"],["12"]],[["2","3","4","5","24"],["17"]],[["1","1","1","1","100000"],["100000"]],[["10","9","8","7","6"],["0"]],[["8","4","4","3","65437"],["32718"]],[["8","4","1","10","59392"],["59392"]],[["4","1","8","7","44835"],["44835"]],[["6","1","7","2","62982"],["62982"]],[["2","7","4","9","56937"],["35246"]],[["2","9","8","1","75083"],["75083"]],[["8","7","7","6","69038"],["24656"]],[["4","4","2","3","54481"],["36320"]],[["6","4","9","8","72628"],["28244"]],[["9","7","8","10","42357"],["16540"]],[["5","6","4","3","60504"],["36302"]],[["7","2","3","8","21754"],["15539"]],[["1","2","10","4","39901"],["39901"]],[["3","4","7","1","58048"],["58048"]],[["9","10","4","6","52003"],["21956"]],[["5","10","9","3","70149"],["32736"]],[["5","5","5","10","55592"],["11118"]],[["1","5","2","6","49547"],["49547"]],[["3","7","7","7","84046"],["36019"]],[["10","2","1","8","63537"],["63537"]],[["7","2","10","5","81684"],["53678"]],[["7","1","6","8","99831"],["99831"]],[["3","9","3","3","61082"],["20360"]],[["5","5","8","9","79228"],["29931"]],[["1","5","5","6","89535"],["89535"]],[["5","5","2","1","7682"],["7682"]],[["7","4","8","8","25829"],["9224"]],[["3","4","3","3","87079"],["43539"]],[["5","8","4","9","5226"],["2438"]],[["4","9","6","6","1070"],["415"]],[["10","10","10","10","100000"],["10000"]],[["1","1","1","1","1"],["1"]],[["10","10","10","10","1"],["0"]],[["10","10","1","10","10"],["10"]],[["10","10","1","10","100"],["100"]],[["2","2","2","2","1"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_54","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nmaxn = constant integer = 1005\na = integer array of size maxn, b = integer array of size maxn, fa = integer array of size maxn, fb = integer array of size maxn\ndefine the main function\n n = integer\n read n\n for i = 1 to n inclusive\n read a[i]\n if i is 1\n fa[i] is a[i]\n else\n fa[i] = bitwise or of fa[i - 1] and a[i]\n end of the block\n for i = 1 to n inclusive\n read b[i]\n if i is 1\n fb[i] = b[i]\n else\n fb[i] = bitwise or of fb[i - 1] and b[i]\n end of the block\n res = long long = 0\n for i = 1 to n inclusive\n for j = 1 inclusive\n t = long long = fb[i] + fa[i] - fa[j - 1] - fb[j - 1]\n res = bigger value between res and t\n end of the block\n end of the block\n print res\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int maxn = 1005;\nint a[maxn], b[maxn], fa[maxn], fb[maxn];\nint main() {\n int n;\n cin >> n;\n for (int i = 1; i <= n; i++) {\n cin >> a[i];\n if (i == 1)\n fa[i] = a[i];\n else\n fa[i] = fa[i - 1] | a[i];\n }\n for (int i = 1; i <= n; i++) {\n cin >> b[i];\n if (i == 1)\n fb[i] = b[i];\n else\n fb[i] = fb[i - 1] | b[i];\n }\n long long res = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= i; j++) {\n long long t = fb[i] + fa[i] - fa[j - 1] - fb[j - 1];\n res = max(res, t);\n }\n }\n cout << res << endl;\n return 0;\n}","item":{"problem_id":"631A","pseudocode":"maxn = constant integer = 1005\na = integer array of size maxn, b = integer array of size maxn, fa = integer array of size maxn, fb = integer array of size maxn\ndefine the main function\n n = integer\n read n\n for i = 1 to n inclusive\n read a[i]\n if i is 1\n fa[i] is a[i]\n else\n fa[i] = bitwise or of fa[i - 1] and a[i]\n end of the block\n for i = 1 to n inclusive\n read b[i]\n if i is 1\n fb[i] = b[i]\n else\n fb[i] = bitwise or of fb[i - 1] and b[i]\n end of the block\n res = long long = 0\n for i = 1 to n inclusive\n for j = 1 inclusive\n t = long long = fb[i] + fa[i] - fa[j - 1] - fb[j - 1]\n res = bigger value between res and t\n end of the block\n end of the block\n print res\n return to indicate successful execution\nend of the block","testcases":[[["5","1 2 4 3 2","2 3 3 12 1"],["22"]],[["10","13 2 7 11 8 4 9 8 5 1","5 7 18 9 2 3 0 11 8 6"],["46"]],[["25","12 30 38 109 81 124 80 33 38 48 29 78 96 48 96 27 80 77 102 65 80 113 31 118 35","25 64 95 13 12 6 111 80 85 16 61 119 23 65 73 65 20 95 124 18 28 79 125 106 116"],["254"]],[["20","64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64","64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64"],["128"]],[["1","1000000000","1000000000"],["2000000000"]],[["1","0","0"],["0"]],[["2","7 16","16 7"],["46"]],[["4","6 0 0 0","0 0 0 1"],["7"]],[["8","1 2 4 8 16 32 64 128","1 2 4 8 16 32 64 128"],["510"]],[["1","2","3"],["5"]],[["1","4","3"],["7"]],[["1","1","1"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_55","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate vector integer v\ncreate integer arrays num, value, with num size 51, value size 51\ndefine the main function\n create integers n, index with index = 1\n read n\n for i = 0 to n exclusive, read num[i]\n add element num[n-1] to end of v\n for i = n - 2 to 0 inclusive, decrementing i\n create integers j, flag with j = 0, flag = 0\n while j is less than size of v\n if num[i] is v[j]\n set flag to 1\n break loop\n end of the block\n increment j\n end of the block\n if not flag, add element num[i] to end of v\n end of the block\n print size of v print newline\n print v[size of v - 1]\n for i = size of v - 2 to 0 inclusive, decrementing i, print \" \" print v[i]\n print newline\nend of the block\n\n[CODE]:","reference_output":"vector v;\nint num[51], value[51];\nint main() {\n int n, index = 1;\n cin >> n;\n for (int i = 0; i < n; i++) { cin >> num[i]; }\n v.push_back(num[n - 1]);\n for (int i = n - 2; i >= 0; i--) {\n int j = 0, flag = 0;\n while (j < v.size()) {\n if (num[i] == v[j]) {\n flag = 1;\n break;\n }\n j++;\n }\n if (!flag) v.push_back(num[i]);\n }\n cout << v.size() << endl;\n cout << v[v.size() - 1];\n for (int i = v.size() - 2; i >= 0; i--) cout << \" \" << v[i];\n cout << endl;\n}","item":{"problem_id":"978A","pseudocode":"create vector integer v\ncreate integer arrays num, value, with num size 51, value size 51\ndefine the main function\n create integers n, index with index = 1\n read n\n for i = 0 to n exclusive, read num[i]\n add element num[n-1] to end of v\n for i = n - 2 to 0 inclusive, decrementing i\n create integers j, flag with j = 0, flag = 0\n while j is less than size of v\n if num[i] is v[j]\n set flag to 1\n break loop\n end of the block\n increment j\n end of the block\n if not flag, add element num[i] to end of v\n end of the block\n print size of v print newline\n print v[size of v - 1]\n for i = size of v - 2 to 0 inclusive, decrementing i, print \" \" print v[i]\n print newline\nend of the block","testcases":[[["6","1 5 5 1 6 1"],["3","5 6 1"]],[["5","2 4 2 4 4"],["2","2 4"]],[["5","6 6 6 6 6"],["1","6"]],[["7","1 2 3 4 2 2 3"],["4","1 4 2 3"]],[["9","100 100 100 99 99 99 100 100 100"],["2","99 100"]],[["27","489 489 487 488 750 230 43 645 42 42 489 42 973 42 973 750 645 355 868 112 868 489 750 489 887 489 868"],["13","487 488 230 43 42 973 645 355 112 750 887 489 868"]],[["40","151 421 421 909 117 222 909 954 227 421 227 954 954 222 421 227 421 421 421 151 421 227 222 222 222 222 421 183 421 227 421 954 222 421 954 421 222 421 909 421"],["8","117 151 183 227 954 222 909 421"]],[["48","2 2 2 903 903 2 726 2 2 2 2 2 2 2 2 2 2 726 2 2 2 2 2 2 2 726 2 2 2 2 62 2 2 2 2 2 2 2 2 726 62 726 2 2 2 903 903 2"],["4","62 726 903 2"]],[["1","1"],["1","1"]],[["13","5 37 375 5 37 33 37 375 37 2 3 3 2"],["6","5 33 375 37 3 2"]],[["50","1 2 3 4 5 4 3 2 1 2 3 2 1 4 5 5 4 3 2 1 1 2 3 4 5 4 3 2 1 2 3 2 1 4 5 5 4 3 2 1 4 3 2 5 1 6 6 6 6 6"],["6","4 3 2 5 1 6"]],[["47","233 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"],["2","233 1"]],[["47","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"],["1","1"]],[["2","964 964"],["1","964"]],[["2","1000 1000"],["1","1000"]],[["1","1000"],["1","1000"]],[["45","991 991 996 996 992 992 999 1000 998 1000 992 999 996 999 991 991 999 993 992 999 1000 997 992 999 996 991 994 996 991 999 1000 993 999 997 999 992 991 997 991 998 998 995 998 994 993"],["10","996 1000 999 992 997 991 995 998 994 993"]],[["6","994 993 1000 998 991 994"],["5","993 1000 998 991 994"]],[["48","992 995 992 991 994 992 995 999 996 993 999 995 993 992 1000 992 997 996 991 993 992 998 998 998 999 995 992 992 993 992 992 995 996 995 997 991 997 991 999 994 994 997 1000 998 1000 992 1000 999"],["10","993 996 995 991 994 997 998 992 1000 999"]],[["3","6 6 3"],["2","6 3"]],[["36","999 1000 993 993 1000 999 996 997 998 995 995 997 999 995 1000 998 998 994 993 998 994 999 1000 995 996 994 991 991 999 996 993 999 996 998 991 997"],["9","1000 995 994 993 999 996 998 991 997"]],[["49","991 997 995 991 995 998 994 996 997 991 998 993 992 999 996 995 991 991 999 997 995 993 997 1000 997 993 993 994 999 994 992 991 1000 996 994 996 996 999 992 992 1000 991 997 993 991 994 997 991 996"],["10","998 995 999 992 1000 993 994 997 991 996"]],[["2","1000 999"],["2","1000 999"]],[["28","997 994 991 994 994 995 1000 992 995 994 994 995 991 996 991 996 991 999 999 993 994 997 995 992 991 992 998 1000"],["10","996 999 993 994 997 995 991 992 998 1000"]],[["15","991 995 995 1000 991 993 997 998 1000 994 1000 992 991 995 992"],["8","993 997 998 994 1000 991 995 992"]],[["6","1000 1 1000 2 1000 1"],["3","2 1000 1"]],[["6","1000 1 1000 2 1 1000"],["3","2 1 1000"]],[["7","1 1000 1 999 1000 1 2"],["4","999 1000 1 2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_56","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integer m\n read m\n create integer x with x = 0\n for i = 1 to m inclusive\n create string s\n read s\n if s is \"X++\" or s is \"++X\"\n increment x\n else if s is \"X--\" or s is \"--X\"\n decrement x\n end of the block\n print x print newline\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int m;\n cin >> m;\n int x = 0;\n for (int i = 1; i <= m; i++) {\n string s;\n cin >> s;\n if (s == \"X++\" || s == \"++X\")\n x++;\n else if (s == \"X--\" || s == \"--X\")\n x--;\n }\n cout << x << endl;\n}","item":{"problem_id":"282A","pseudocode":"define the main function\n create integer m\n read m\n create integer x with x = 0\n for i = 1 to m inclusive\n create string s\n read s\n if s is \"X++\" or s is \"++X\"\n increment x\n else if s is \"X--\" or s is \"--X\"\n decrement x\n end of the block\n print x print newline\nend of the block","testcases":[[["1","++X"],["1"]],[["2","X++","--X"],["0"]],[["3","++X","++X","++X"],["3"]],[["2","--X","--X"],["-2"]],[["5","++X","--X","++X","--X","--X"],["-1"]],[["28","X--","++X","X++","X++","X++","--X","--X","X++","X--","++X","X++","--X","X--","X++","X--","++X","++X","X++","X++","X++","X++","--X","++X","--X","--X","--X","--X","X++"],["4"]],[["94","X++","X++","++X","++X","X--","--X","X++","--X","X++","++X","X++","++X","--X","--X","++X","X++","--X","X--","X--","--X","X--","X--","--X","++X","--X","X--","X--","X++","++X","--X","X--","++X","--X","--X","X--","X--","X++","X++","X--","X++","X--","X--","X--","--X","X--","X--","X--","X++","++X","X--","++X","X++","--X","--X","--X","--X","++X","X--","--X","--X","++X","X--","X--","X++","++X","X++","++X","--X","--X","X--","++X","X--","X--","++X","++X","++X","++X","X++","++X","--X","X++","--X","--X","++X","--X","X++","++X","X++","--X","X--","X--","--X","++X","X++"],["-10"]],[["56","--X","X--","--X","--X","X--","X--","--X","X++","++X","--X","X++","X--","--X","++X","--X","X--","X--","++X","X--","X--","--X","++X","--X","++X","--X","X++","++X","X++","--X","++X","X++","X++","--X","X++","X--","--X","X--","--X","X++","++X","--X","++X","X++","X--","--X","--X","++X","X--","X--","--X","X--","--X","X++","--X","++X","--X"],["-14"]],[["59","X--","--X","X++","++X","X--","--X","--X","++X","++X","++X","++X","X++","++X","++X","X++","--X","X--","X++","++X","--X","X++","--X","++X","X++","--X","--X","X++","X++","--X","X++","X++","X++","X--","X--","--X","X++","X--","X--","++X","X--","X++","--X","X++","X--","X--","X--","X--","++X","--X","X++","X++","X--","X++","++X","X--","X++","X--","X--","++X"],["3"]],[["87","--X","++X","--X","X++","--X","X--","--X","++X","X--","++X","--X","--X","X++","--X","X--","X++","++X","--X","++X","++X","--X","++X","--X","X--","++X","++X","X--","X++","X++","--X","--X","++X","X--","--X","++X","--X","X++","--X","--X","X--","++X","++X","--X","X--","X--","X--","X--","X--","X++","--X","++X","--X","X++","++X","X++","++X","--X","X++","++X","X--","--X","X++","++X","X++","X++","--X","--X","++X","--X","X++","X++","++X","X++","X++","X++","X++","--X","--X","--X","--X","--X","--X","--X","X--","--X","++X","++X"],["-5"]],[["101","X++","X++","X++","++X","--X","X--","X++","X--","X--","--X","--X","++X","X++","++X","++X","X--","--X","++X","X++","X--","++X","--X","--X","--X","++X","--X","++X","X++","X++","++X","--X","X++","X--","X++","++X","++X","X--","X--","X--","X++","X++","X--","X--","X++","++X","++X","++X","--X","--X","++X","X--","X--","--X","++X","X--","++X","X++","++X","X--","X--","--X","++X","--X","++X","++X","--X","X++","++X","X--","++X","X--","++X","X++","X--","++X","X++","--X","X++","X++","++X","--X","++X","--X","X++","--X","X--","--X","++X","++X","++X","--X","X--","X--","X--","X--","--X","--X","--X","++X","--X","--X"],["1"]],[["63","--X","X--","++X","--X","++X","X++","--X","--X","X++","--X","--X","X++","X--","X--","--X","++X","X--","X--","X++","++X","X++","X++","--X","--X","++X","X--","X--","X--","++X","X++","X--","--X","X--","++X","++X","X++","++X","X++","X++","--X","X--","++X","X--","--X","X--","X--","X--","++X","++X","++X","++X","X++","X++","++X","--X","--X","++X","++X","++X","X--","++X","++X","X--"],["1"]],[["45","--X","++X","X--","++X","++X","X++","--X","--X","--X","--X","--X","--X","--X","X++","++X","X--","++X","++X","X--","X++","X--","--X","X--","++X","++X","--X","--X","X--","X--","--X","++X","X--","--X","++X","++X","--X","--X","X--","++X","++X","X++","X++","++X","++X","X++"],["-3"]],[["21","++X","X++","--X","X--","X++","++X","--X","X--","X++","X--","X--","X--","X++","++X","X++","++X","--X","X--","--X","X++","++X"],["1"]],[["100","--X","++X","X++","++X","X--","++X","X--","X++","--X","X++","X--","X--","X--","++X","X--","X++","X++","++X","X++","X++","X++","X++","++X","X++","++X","X--","--X","++X","X--","--X","++X","++X","X--","X++","X++","X++","++X","--X","++X","X++","X--","++X","++X","--X","++X","X--","X--","X--","X++","X--","X--","X++","X++","--X","X++","X++","--X","X--","--X","++X","--X","++X","++X","X--","--X","++X","++X","--X","--X","++X","X++","X--","X++","X--","X++","X++","--X","X--","X--","++X","X--","--X","--X","X++","--X","--X","X--","X--","++X","++X","X--","++X","X++","--X","++X","++X","X++","--X","--X","X++"],["8"]],[["17","X++","X++","++X","--X","--X","++X","++X","--X","X--","X++","X--","--X","--X","X--","++X","X--","X++"],["-1"]],[["77","++X","X++","--X","X--","--X","--X","X--","X++","X--","X++","X--","++X","--X","--X","--X","--X","++X","X--","X++","X--","--X","X--","--X","X--","++X","--X","++X","++X","X++","X++","X--","--X","X--","X--","X++","--X","--X","++X","X--","X--","++X","X++","X--","++X","--X","X++","X--","++X","++X","++X","X--","X--","X--","--X","++X","++X","++X","X++","--X","--X","++X","--X","X--","X++","++X","X++","++X","X--","X++","X++","--X","X++","X++","X++","--X","X++","X--"],["-5"]],[["21","X--","++X","--X","X--","++X","X--","++X","X--","--X","++X","X++","++X","X++","++X","X--","--X","X++","X++","X--","++X","X--"],["1"]],[["1","X--"],["-1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_57","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare ints n, v, sum and cnt\ncreate int array ans with size 60 and 2d array s with 60 by 60\ndefine the main function\n read user input to n and v\n change the value of sum to 0\n change cnt to 0\n start for loop from i1 = 0 to n exclusive\n create integer k\n read user input to k\n in a for loop, change i2 from 0 to k exclusive\n read s[i1][i2] from the user input\n increment sum if v is greater than s[i1][i2]\n end of the block\n if sum is greater than 0\n assign i1 + 1 to ans[cnt]\n increment cnt\n end of the block\n set sum to 0\n end of the block\n print cnt to the standard output\n for i2 = 0 to cnt exclusive\n if i2 != cnt - 1\n print ans[i2] and \" \" to the standard output\n else\n print ans[i2]\n end of the block\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int n, v, sum, cnt;\nint s[60][60], ans[60];\nint main() {\n cin >> n >> v;\n sum = 0;\n cnt = 0;\n for (int i1 = 0; i1 < n; i1++) {\n int k;\n cin >> k;\n for (int i2 = 0; i2 < k; i2++) {\n cin >> s[i1][i2];\n if (v > s[i1][i2]) { sum++; }\n }\n if (sum > 0) {\n ans[cnt] = i1 + 1;\n cnt++;\n }\n sum = 0;\n }\n cout << cnt << endl;\n for (int i2 = 0; i2 < cnt; i2++) {\n if (i2 != cnt - 1) {\n cout << ans[i2] << \" \";\n } else {\n cout << ans[i2] << endl;\n }\n }\n return 0;\n}","item":{"problem_id":"441A","pseudocode":"declare ints n, v, sum and cnt\ncreate int array ans with size 60 and 2d array s with 60 by 60\ndefine the main function\n read user input to n and v\n change the value of sum to 0\n change cnt to 0\n start for loop from i1 = 0 to n exclusive\n create integer k\n read user input to k\n in a for loop, change i2 from 0 to k exclusive\n read s[i1][i2] from the user input\n increment sum if v is greater than s[i1][i2]\n end of the block\n if sum is greater than 0\n assign i1 + 1 to ans[cnt]\n increment cnt\n end of the block\n set sum to 0\n end of the block\n print cnt to the standard output\n for i2 = 0 to cnt exclusive\n if i2 != cnt - 1\n print ans[i2] and \" \" to the standard output\n else\n print ans[i2]\n end of the block\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["3 50000","1 40000","2 20000 60000","3 10000 70000 190000"],["3","1 2 3"]],[["3 50000","1 50000","3 100000 120000 110000","3 120000 110000 120000"],["0"]],[["2 100001","1 895737","1 541571"],["0"]],[["1 1000000","1 1000000"],["0"]],[["1 1000000","1 561774"],["1","1"]],[["3 1000000","5 1000000 568832 1000000 1000000 1000000","13 1000000 1000000 1000000 596527 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000","20 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000"],["2","1 2"]],[["3 999999","7 1000000 1000000 1000000 999999 1000000 999999 1000000","6 999999 1000000 999999 1000000 999999 999999","7 999999 1000000 1000000 999999 1000000 1000000 1000000"],["0"]],[["3 999999","22 1000000 1000000 999999 999999 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 999999 1000000 1000000 999999 1000000 1000000 1000000 352800 999999 1000000","14 999999 999999 999999 999999 999999 1000000 999999 999999 999999 999999 702638 999999 1000000 999999","5 999999 1000000 1000000 999999 363236"],["3","1 2 3"]],[["1 50001","1 50000"],["1","1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_58","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare integer n\ndeclare integer array arr size 100001\ndeclare maxi = 0 as integer\ndeclare solve with integer i as argument, returning integer\n if i is n, return 0\n declare integer ret = result of run solve ( i + 1 )\n if i is n - 1, return 1 from function\n if arr[i] is less than or equal to arr[i+1], return ret + 1\n let maxi be maximum of maxi and ret\n return 1 from function\nend of the block\ndefine the main function\n read n\n for i = 0 to n exclusive, read arr[i]\n declare integer ret = result of run solve(0)\n print maximum of ret and maxi, newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int n;\nint arr[100001];\nint maxi = 0;\nint solve(int i) {\n if (i == n) return 0;\n int ret = solve(i + 1);\n if (i == n - 1) return 1;\n if (arr[i] <= arr[i + 1]) return ret + 1;\n maxi = max(maxi, ret);\n return 1;\n}\nint main() {\n cin >> n;\n for (int i = 0; i < n; i++) cin >> arr[i];\n int ret = solve(0);\n cout << max(ret, maxi) << endl;\n return 0;\n}","item":{"problem_id":"580A","pseudocode":"declare integer n\ndeclare integer array arr size 100001\ndeclare maxi = 0 as integer\ndeclare solve with integer i as argument, returning integer\n if i is n, return 0\n declare integer ret = result of run solve ( i + 1 )\n if i is n - 1, return 1 from function\n if arr[i] is less than or equal to arr[i+1], return ret + 1\n let maxi be maximum of maxi and ret\n return 1 from function\nend of the block\ndefine the main function\n read n\n for i = 0 to n exclusive, read arr[i]\n declare integer ret = result of run solve(0)\n print maximum of ret and maxi, newline\n return to indicate successful execution\nend of the block","testcases":[[["6","2 2 1 3 4 1"],["3"]],[["3","2 2 9"],["3"]],[["5","10 100 111 1 2"],["3"]],[["10","1 2 3 4 1 2 3 4 5 6"],["6"]],[["50","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"],["50"]],[["100","1 838 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1 605 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1 27 533 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1 835 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1 992"],["42"]],[["1","1"],["1"]],[["2","1 1"],["2"]],[["6","5 4 3 2 1 2"],["2"]],[["9","1 2 3 4 5 6 7 8 9"],["9"]],[["7","99 100 1 2 3 4 5"],["5"]],[["5","3 3 1 2 3"],["3"]],[["1","100"],["1"]],[["1","5"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_59","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let m, a, b, c be integers\n read m\n for i = 1 to m inclusive\n read a\n if a >= 180 or a <= 0\n print NO with newline\n continue\n end of the block\n if (360 \/ (180 - a) - int of (360 \/ (180 - a))) <= 0\n print YES\n else\n print NO\n end of the block\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int m, a, b, c;\n cin >> m;\n for (int i = 1; i <= m; i++) {\n cin >> a;\n if (a >= 180 || a <= 0) {\n cout << \"NO\" << endl;\n continue;\n }\n if ((360.0 \/ (180 - a) - int(360 \/ (180 - a)) <= 0))\n cout << \"YES\" << endl;\n else {\n cout << \"NO\" << endl;\n }\n }\n}","item":{"problem_id":"270A","pseudocode":"define the main function\n let m, a, b, c be integers\n read m\n for i = 1 to m inclusive\n read a\n if a >= 180 or a <= 0\n print NO with newline\n continue\n end of the block\n if (360 \/ (180 - a) - int of (360 \/ (180 - a))) <= 0\n print YES\n else\n print NO\n end of the block\n end of the block\nend of the block","testcases":[[["3","30","60","90"],["NO","YES","YES"]],[["6","1","2","3","170","179","25"],["NO","NO","NO","YES","YES","NO"]],[["10","152","9","20","12","90","3","173","44","96","90"],["NO","NO","NO","NO","YES","NO","NO","NO","NO","YES"]],[["20","135","71","163","36","34","20","15","172","110","101","39","175","165","42","16","170","45","156","9","159"],["YES","NO","NO","NO","NO","NO","NO","YES","NO","NO","NO","YES","YES","NO","NO","YES","NO","YES","NO","NO"]],[["20","18","59","45","10","44","30","102","25","11","159","97","52","12","145","72","18","160","5","154","94"],["NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","YES","NO","NO","NO"]],[["20","108","31","15","114","64","45","2","5","78","132","49","39","135","130","143","146","54","133","4","50"],["YES","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","YES","NO","NO","NO","NO","NO","NO","NO"]],[["20","60","1","5","18","5","15","3","15","30","3","3","10","90","90","1","9","2","6","15","2"],["YES","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","YES","YES","NO","NO","NO","NO","NO","NO"]],[["20","12","85","90","122","14","42","165","5","18","45","20","104","179","2","10","156","34","90","12","36"],["NO","NO","YES","NO","NO","NO","YES","NO","NO","NO","NO","NO","YES","NO","NO","YES","NO","YES","NO","NO"]],[["15","80","45","4","10","36","93","60","1","51","15","18","174","18","3","45"],["NO","NO","NO","NO","NO","NO","YES","NO","NO","NO","NO","YES","NO","NO","NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_60","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create ints n, m, mint and maxt\n read standard input to n, m, mint and maxt\n declare integer variables cmin and cmax\n read cmin\n assign the new value = cmin to cmax\n for i from 1 to m exclusive\n define new integer called a\n read standard input to a\n set cmin to min of cmin and a\n assign max of cmax and a to cmax\n end of the block\n begin try-catch block\n if cmin < mint or maxt < cmax, throw error with code 1\n if n - m is less than cmin != mint + cmax != maxt, throw error with code 1\n print \"Correct\\n\"\n catch erorr and put it's code into new integer a, then print \"Incorrect\\n\"\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, m, mint, maxt;\n cin >> n >> m >> mint >> maxt;\n int cmin, cmax;\n cin >> cmin;\n cmax = cmin;\n for (int i = 1; i < m; i++) {\n int a;\n cin >> a;\n cmin = min(cmin, a);\n cmax = max(cmax, a);\n }\n try {\n if (cmin < mint || maxt < cmax) throw 1;\n if (n - m < int(cmin != mint) + (cmax != maxt)) throw 1;\n cout << \"Correct\\n\";\n } catch (int a) { cout << \"Incorrect\\n\"; }\n return 0;\n}","item":{"problem_id":"413A","pseudocode":"define the main function\n create ints n, m, mint and maxt\n read standard input to n, m, mint and maxt\n declare integer variables cmin and cmax\n read cmin\n assign the new value = cmin to cmax\n for i from 1 to m exclusive\n define new integer called a\n read standard input to a\n set cmin to min of cmin and a\n assign max of cmax and a to cmax\n end of the block\n begin try-catch block\n if cmin < mint or maxt < cmax, throw error with code 1\n if n - m is less than cmin != mint + cmax != maxt, throw error with code 1\n print \"Correct\\n\"\n catch erorr and put it's code into new integer a, then print \"Incorrect\\n\"\n return to indicate successful execution\nend of the block","testcases":[[["2 1 1 2","1"],["Correct"]],[["3 1 1 3","2"],["Correct"]],[["2 1 1 3","2"],["Incorrect"]],[["3 1 1 5","3"],["Correct"]],[["3 2 1 5","1 5"],["Correct"]],[["3 2 1 5","1 1"],["Correct"]],[["3 2 1 5","5 5"],["Correct"]],[["3 2 1 5","1 6"],["Incorrect"]],[["3 2 5 10","1 10"],["Incorrect"]],[["6 5 3 6","4 4 4 4 4"],["Incorrect"]],[["100 50 68 97","20 42 93 1 98 6 32 11 48 46 82 96 24 73 40 100 99 10 55 87 65 80 97 54 59 48 30 22 16 92 66 2 22 60 23 81 64 60 34 60 99 99 4 70 91 99 30 20 41 96"],["Incorrect"]],[["100 50 1 2","1 1 2 1 1 2 2 1 1 1 1 1 2 2 1 2 1 2 2 1 1 1 2 2 2 1 1 2 1 1 1 1 2 2 1 1 1 1 1 2 1 1 1 2 1 2 2 2 1 2"],["Correct"]],[["100 99 1 2","2 1 1 1 2 2 1 1 1 2 2 2 1 2 1 1 2 1 1 2 1 2 2 1 2 1 2 1 2 1 2 2 2 2 1 1 1 1 1 2 1 2 2 1 2 2 2 1 1 1 1 1 2 2 2 2 1 2 2 1 1 1 2 1 1 2 1 1 2 1 2 1 2 1 1 1 1 2 1 1 1 1 1 2 2 2 1 1 1 1 2 2 2 2 1 1 2 2 2"],["Correct"]],[["3 2 2 100","40 1"],["Incorrect"]],[["3 2 2 3","4 4"],["Incorrect"]],[["5 2 2 4","2 2"],["Correct"]],[["5 1 1 4","1"],["Correct"]],[["9 7 1 4","4 3 3 2 2 4 1"],["Correct"]],[["9 5 2 3","4 2 4 3 3"],["Incorrect"]],[["6 3 1 3","1 4 2"],["Incorrect"]],[["3 2 1 99","34 100"],["Incorrect"]],[["4 2 1 99","100 38"],["Incorrect"]],[["5 2 1 99","100 38"],["Incorrect"]],[["4 2 1 99","36 51"],["Correct"]],[["7 6 3 10","5 10 7 7 4 5"],["Correct"]],[["8 6 3 10","8 5 7 8 4 4"],["Correct"]],[["9 6 3 10","9 7 7 5 3 10"],["Correct"]],[["16 15 30 40","36 37 35 36 34 34 37 35 32 33 31 38 39 38 38"],["Incorrect"]],[["17 15 30 40","38 36 37 34 30 38 38 31 38 38 36 39 39 37 35"],["Correct"]],[["18 15 30 40","35 37 31 32 30 33 36 38 36 38 31 30 39 32 36"],["Correct"]],[["17 16 30 40","39 32 37 31 40 32 36 34 56 34 40 36 37 36 33 36"],["Incorrect"]],[["18 16 30 40","32 35 33 39 34 30 37 34 30 34 39 18 32 37 37 36"],["Incorrect"]],[["19 16 30 40","36 30 37 30 37 32 34 30 35 35 33 35 39 37 46 37"],["Incorrect"]],[["2 1 2 100","38"],["Incorrect"]],[["3 1 2 100","1"],["Incorrect"]],[["4 1 2 100","1"],["Incorrect"]],[["91 38 1 3","3 2 3 2 3 2 3 3 1 1 1 2 2 1 3 2 3 1 3 3 1 3 3 2 1 2 2 3 1 2 1 3 2 2 3 1 1 2"],["Correct"]],[["4 3 2 10","6 3 10"],["Correct"]],[["41 6 4 10","10 7 4 9 9 10"],["Correct"]],[["21 1 1 9","9"],["Correct"]],[["2 1 9 10","10"],["Correct"]],[["2 1 2 9","9"],["Correct"]],[["8 7 5 9","6 7 8 5 5 6 6"],["Correct"]],[["3 2 2 8","7 2"],["Correct"]],[["71 36 1 10","7 10 8 1 3 8 5 7 3 10 8 1 6 4 5 7 8 2 4 3 4 10 8 5 1 2 8 8 10 10 4 3 7 9 7 8"],["Correct"]],[["85 3 4 9","4 8 7"],["Correct"]],[["4 3 4 10","9 10 5"],["Correct"]],[["2 1 1 5","1"],["Correct"]],[["91 75 1 10","2 6 9 7 4 9 4 8 10 6 4 1 10 6 5 9 7 5 1 4 6 4 8 2 1 3 5 7 6 9 5 5 8 1 7 1 4 2 8 3 1 6 6 2 10 6 2 2 8 5 4 5 5 3 10 9 4 3 1 9 10 3 2 4 8 7 4 9 3 1 1 1 3 4 5"],["Correct"]],[["10 4 1 8","7 9 6 6"],["Incorrect"]],[["18 1 3 10","2"],["Incorrect"]],[["6 2 4 8","6 3"],["Incorrect"]],[["17 6 2 8","3 8 6 1 6 4"],["Incorrect"]],[["21 1 5 8","4"],["Incorrect"]],[["2 1 1 10","9"],["Incorrect"]],[["2 1 4 8","5"],["Incorrect"]],[["2 1 1 7","6"],["Incorrect"]],[["2 1 4 9","5"],["Incorrect"]],[["2 1 3 8","7"],["Incorrect"]],[["2 1 5 9","6"],["Incorrect"]],[["3 2 1 10","4 9"],["Incorrect"]],[["2 1 4 10","7"],["Incorrect"]],[["2 1 2 9","8"],["Incorrect"]],[["2 1 3 9","3"],["Correct"]],[["3 2 6 7","6 6"],["Correct"]],[["6 4 1 10","11 10 9 1"],["Incorrect"]],[["7 6 3 8","3 4 5 6 7 8"],["Correct"]],[["5 3 1 5","2 3 4"],["Correct"]]]}} +{"instance_id":"pseudo_to_code_0.5k_61","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nstr=array of 105 strings\ndefine the main function\n n,m=int\n read n,m\n read str+1\n while m is not 0, decrement m\n l,r=int\n c1,c2=char\n read l,r,c1,c2\n for i=l to r inclusive\n if str[i] is c1 str[i]=c2\n end of the block\n end of the block\n print str+1\nend of the block\n\n[CODE]:","reference_output":"char str[105];\nint main() {\n int n, m;\n cin >> n >> m;\n cin >> str + 1;\n while (m--) {\n int l, r;\n char c1, c2;\n cin >> l >> r >> c1 >> c2;\n for (int i = l; i <= r; ++i) {\n if (str[i] == c1) str[i] = c2;\n }\n }\n cout << str + 1 << endl;\n}","item":{"problem_id":"897A","pseudocode":"str=array of 105 strings\ndefine the main function\n n,m=int\n read n,m\n read str+1\n while m is not 0, decrement m\n l,r=int\n c1,c2=char\n read l,r,c1,c2\n for i=l to r inclusive\n if str[i] is c1 str[i]=c2\n end of the block\n end of the block\n print str+1\nend of the block","testcases":[[["3 1","ioi","1 1 i n"],["noi"]],[["5 3","wxhak","3 3 h x","1 5 x a","1 3 w g"],["gaaak"]],[["9 51","bhfbdcgff","2 3 b b","2 8 e f","3 8 g f","5 7 d a","1 5 e b","3 4 g b","6 7 c d","3 6 e g","3 6 e h","5 6 a e","7 9 a c","4 9 a h","3 7 c b","6 9 b g","1 7 h b","4 5 a e","3 9 f a","1 2 c h","4 8 a c","3 5 e d","3 4 g f","2 3 d h","2 3 d e","1 7 d g","2 6 e g","2 3 d g","5 5 h h","2 8 g d","8 9 a f","5 9 c e","1 7 f d","1 6 e e","5 7 c a","8 9 b b","2 6 e b","6 6 g h","1 2 b b","1 5 a f","5 8 f h","1 5 e g","3 9 f h","6 8 g a","4 6 h g","1 5 f a","5 6 a c","4 8 e d","1 4 d g","7 8 b f","5 6 h b","3 9 c e","1 9 b a"],["aahaddddh"]],[["28 45","dcbbaddjhbeefjadjchgkhgggfha","10 25 c a","13 19 a f","12 28 e d","12 27 e a","9 20 b e","7 17 g d","22 26 j j","8 16 c g","14 16 a d","3 10 f c","10 26 d b","8 17 i e","10 19 d i","6 21 c j","7 22 b k","17 19 a i","4 18 j k","8 25 a g","10 27 j e","9 18 g d","16 23 h a","17 26 k e","8 16 h f","1 15 d f","22 28 k k","11 20 c k","6 11 b h","17 17 e i","15 22 g h","8 18 c f","4 16 e a","8 25 b c","6 24 d g","5 9 f j","12 19 i h","4 25 e f","15 25 c j","15 27 e e","11 20 b f","19 27 e k","2 21 d a","9 27 k e","14 24 b a","3 6 i g","2 26 k f"],["fcbbajjfjaaefefehfahfagggfha"]],[["87 5","nfinedeojadjmgafnaogekfjkjfncnliagfchjfcmellgigjjcaaoeakdolchjcecljdeblmheimkibkgdkcdml","47 56 a k","51 81 o d","5 11 j h","48 62 j d","16 30 k m"],["nfinedeohadjmgafnaogemfjmjfncnliagfchjfcmellgigddckkdekkddlchdcecljdeblmheimkibkgdkcdml"]],[["5 16","acfbb","1 2 e f","2 5 a f","2 3 b e","4 4 f a","2 3 f a","1 2 b e","4 5 c d","2 4 e c","1 4 e a","1 3 d c","3 5 e b","3 5 e b","2 2 e d","1 3 e c","3 3 a e","1 5 a a"],["acebb"]],[["94 13","bcaaaaaaccacddcdaacbdaabbcbaddbccbccbbbddbadddcccbddadddaadbdababadaacdcdbcdadabdcdcbcbcbcbbcd","52 77 d d","21 92 d b","45 48 c b","20 25 d a","57 88 d b","3 91 b d","64 73 a a","5 83 b d","2 69 c c","28 89 a b","49 67 c b","41 62 a c","49 87 b c"],["bcaaaaaaccacddcdaacddaaddcdbdddccdccddddddbdddddcdddcdddccdddcdcdcdcccdcddcdcdcddcdcdcdcdcdbcd"]],[["67 39","acbcbccccbabaabcabcaaaaaaccbcbbcbaaaacbbcccbcbabbcacccbbabbabbabaac","4 36 a b","25 38 a a","3 44 b c","35 57 b a","4 8 a c","20 67 c a","30 66 b b","27 40 a a","2 56 a b","10 47 c a","22 65 c b","29 42 a b","1 46 c b","57 64 b c","20 29 b a","14 51 c a","12 55 b b","20 20 a c","2 57 c a","22 60 c b","16 51 c c","31 64 a c","17 30 c a","23 36 c c","28 67 a c","37 40 a c","37 50 b c","29 48 c b","2 34 b c","21 53 b a","26 63 a c","23 28 c a","51 56 c b","32 61 b b","64 67 b b","21 67 b c","8 53 c c","40 62 b b","32 38 c c"],["accccccccaaaaaaaaaaaaaaaaaaaccccccccccccccccccccccccccccccccccccccc"]],[["53 33","hhcbhfafeececbhadfbdbehdfacfchbhdbfebdfeghebfcgdhehfh","27 41 h g","18 35 c b","15 46 h f","48 53 e g","30 41 b c","12 30 b f","10 37 e f","18 43 a h","10 52 d a","22 48 c e","40 53 f d","7 12 b h","12 51 f a","3 53 g a","19 41 d h","22 29 b h","2 30 a b","26 28 e h","25 35 f a","19 31 h h","44 44 d e","19 22 e c","29 44 d h","25 33 d h","3 53 g c","18 44 h b","19 28 f e","3 22 g h","8 17 c a","37 51 d d","3 28 e h","27 50 h h","27 46 f b"],["hhcbhfbfhfababbbbbbbbbbbbbbbbbeaaeaaeaaeabebdeaahahdh"]],[["83 10","fhbecdgadecabbbecedcgfdcefcbgechbedagecgdgfgdaahchdgchbeaedgafdefecdchceececfcdhcdh","9 77 e e","26 34 b g","34 70 b a","40 64 e g","33 78 h f","14 26 a a","17 70 d g","56 65 a c","8 41 d c","11 82 c b"],["fhbecdgacebabbbebegbgfgbefbggebhgegagebgggfggaafbfggbfagbgggbfggfebgbfbeebebfbdhbdh"]],[["1 4","e","1 1 c e","1 1 e a","1 1 e c","1 1 d a"],["a"]],[["71 21","aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","61 61 a a","32 56 a a","10 67 a a","7 32 a a","26 66 a a","41 55 a a","49 55 a a","4 61 a a","53 59 a a","37 58 a a","7 63 a a","39 40 a a","51 64 a a","27 37 a a","22 71 a a","4 45 a a","7 8 a a","43 46 a a","19 28 a a","51 54 a a","14 67 a a"],["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"]],[["30 4","eaaddabedcbbcccddbabdecadcecce","2 17 c a","16 29 e e","16 21 c b","7 11 b c"],["eaaddacedacbaaaddbabdecadcecce"]],[["48 30","aaaabaabbaababbbaabaabaababbabbbaabbbaabaaaaaaba","3 45 a b","1 14 a a","15 32 a b","37 47 a b","9 35 a b","36 39 b b","6 26 a b","36 44 a a","28 44 b a","29 31 b a","20 39 a a","45 45 a b","21 32 b b","7 43 a b","14 48 a b","14 33 a b","39 44 a a","9 36 b b","4 23 b b","9 42 b b","41 41 b a","30 47 a b","8 42 b a","14 38 b b","3 15 a a","35 47 b b","14 34 a b","38 43 a b","1 35 b a","16 28 b a"],["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbb"]],[["89 29","babaabaaabaaaababbbbbbbabbbaaaaababbaababababbababaaabbababaaabbbbaaabaaaaaabaaabaabbabab","39 70 b b","3 56 b b","5 22 b a","4 39 a b","41 87 b b","34 41 a a","10 86 a b","29 75 a b","2 68 a a","27 28 b b","42 51 b a","18 61 a a","6 67 b a","47 63 a a","8 68 a b","4 74 b a","19 65 a b","8 55 a b","5 30 a a","3 65 a b","16 57 a b","34 56 b a","1 70 a b","59 68 b b","29 57 b a","47 49 b b","49 73 a a","32 61 b b","29 42 a a"],["bbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbaaaabbbbbbbbbbbbbab"]],[["59 14","fbebcfabdefbaaedcefdeecababcabebadfbccaaedaebfdaefdbbcbebbe","5 32 e f","8 46 e e","31 43 e f","3 10 e a","53 54 f d","55 59 d a","39 58 e b","54 56 f a","9 40 b e","28 37 d a","7 35 e b","7 56 c f","23 26 e a","15 44 e d"],["fbabcfabdffbaafdfffdfffababfabfbaafdffaafdabbfdabfdbbfbbbbe"]],[["7 17","bbaabab","3 5 a b","5 7 a a","5 5 a a","4 4 b a","7 7 a a","5 6 b b","1 3 b a","6 7 a b","4 6 a b","6 6 a a","2 4 b a","1 7 b a","4 6 b b","2 5 b b","2 5 a b","1 4 a a","4 4 b a"],["abbabaa"]],[["100 1","debaaagbfdgehagadabfgheegggfghghgeeeabgceffeffggcbcegfgebbdhebhfagcgadcbdbabddbcadgbgdebdfehceehcaef","13 99 f c"],["debaaagbfdgehagadabcgheegggcghghgeeeabgcecceccggcbcegcgebbdhebhcagcgadcbdbabddbcadgbgdebdcehceehcaef"]],[["1 1","a","1 1 a b"],["b"]],[["100 1","aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","1 100 a b"],["bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"]],[["2 2","aa","1 2 a b","1 2 b c"],["cc"]],[["3 3","aaa","1 3 a b","1 3 b c","1 3 c d"],["ddd"]],[["2 2","aa","2 2 a b","1 1 a b"],["bb"]]]}} +{"instance_id":"pseudo_to_code_0.5k_62","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create new integer called a\n for i from 1 to 5 inclusive\n in a for loop, change j from 1 to 5 inclusive incrementing j\n read input to a\n if a is equal to 1, print (abs(3 - i) + abs(3 - j)) to the output\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int a;\n for (int i = 1; i <= 5; i++)\n for (int j = 1; j <= 5; j++) {\n cin >> a;\n if (a == 1) cout << (abs(3 - i) + abs(3 - j)) << endl;\n }\n}","item":{"problem_id":"263A","pseudocode":"define the main function\n create new integer called a\n for i from 1 to 5 inclusive\n in a for loop, change j from 1 to 5 inclusive incrementing j\n read input to a\n if a is equal to 1, print (abs(3 - i) + abs(3 - j)) to the output\n end of the block\nend of the block","testcases":[[["0 0 0 0 0","0 0 0 0 1","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["3"]],[["0 0 0 0 0","0 0 0 0 0","0 1 0 0 0","0 0 0 0 0","0 0 0 0 0"],["1"]],[["0 0 0 0 0","0 0 0 0 0","0 0 1 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 0 0 0","0 0 0 0 0","0 0 0 0 1"],["4"]],[["0 1 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["3"]],[["1 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["4"]],[["0 0 1 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 1 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["3"]],[["0 0 0 0 1","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["4"]],[["0 0 0 0 0","1 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["3"]],[["0 0 0 0 0","0 1 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 1 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["1"]],[["0 0 0 0 0","0 0 0 1 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","1 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 1 0","0 0 0 0 0","0 0 0 0 0"],["1"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 1","0 0 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","1 0 0 0 0","0 0 0 0 0"],["3"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 1 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 1 0 0","0 0 0 0 0"],["1"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 1 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 1","0 0 0 0 0"],["3"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","1 0 0 0 0"],["4"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 1 0 0 0"],["3"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 1 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 1 0"],["3"]]]}} +{"instance_id":"pseudo_to_code_0.5k_63","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n number = integer\n sum = long\n ok is boolean = false\n read number\n if number is equal to 1 set ok to true\n for counter = 1 to number exclusive\n increase sum by counter\n if sum is equal to number set ok to true\n end of the block\n if ok is true\n print \"YES\" and a new line\n else\n print \"NO\" and a new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int number;\n long sum = 0;\n bool ok = false;\n cin >> number;\n if (number == 1) ok = true;\n for (int counter = 1; counter < number; ++counter) {\n sum += counter;\n if (sum == number) ok = true;\n }\n if (ok)\n cout << \"YES\" << endl;\n else\n cout << \"NO\" << endl;\n return 0;\n}","item":{"problem_id":"47A","pseudocode":"define the main function\n number = integer\n sum = long\n ok is boolean = false\n read number\n if number is equal to 1 set ok to true\n for counter = 1 to number exclusive\n increase sum by counter\n if sum is equal to number set ok to true\n end of the block\n if ok is true\n print \"YES\" and a new line\n else\n print \"NO\" and a new line\n return to indicate successful execution\nend of the block","testcases":[[["1"],["YES"]],[["2"],["NO"]],[["3"],["YES"]],[["4"],["NO"]],[["5"],["NO"]],[["6"],["YES"]],[["7"],["NO"]],[["8"],["NO"]],[["12"],["NO"]],[["10"],["YES"]],[["11"],["NO"]],[["9"],["NO"]],[["14"],["NO"]],[["15"],["YES"]],[["16"],["NO"]],[["20"],["NO"]],[["21"],["YES"]],[["22"],["NO"]],[["121"],["NO"]],[["135"],["NO"]],[["136"],["YES"]],[["137"],["NO"]],[["152"],["NO"]],[["153"],["YES"]],[["154"],["NO"]],[["171"],["YES"]],[["189"],["NO"]],[["190"],["YES"]],[["191"],["NO"]],[["210"],["YES"]],[["211"],["NO"]],[["231"],["YES"]],[["232"],["NO"]],[["252"],["NO"]],[["253"],["YES"]],[["254"],["NO"]],[["275"],["NO"]],[["276"],["YES"]],[["277"],["NO"]],[["299"],["NO"]],[["300"],["YES"]],[["301"],["NO"]],[["324"],["NO"]],[["325"],["YES"]],[["326"],["NO"]],[["350"],["NO"]],[["351"],["YES"]],[["352"],["NO"]],[["377"],["NO"]],[["378"],["YES"]],[["406"],["YES"]],[["434"],["NO"]],[["435"],["YES"]],[["464"],["NO"]],[["465"],["YES"]],[["495"],["NO"]],[["496"],["YES"]],[["497"],["NO"]],[["331"],["NO"]],[["413"],["NO"]],[["177"],["NO"]],[["122"],["NO"]],[["478"],["NO"]],[["188"],["NO"]],[["21"],["YES"]],[["474"],["NO"]],[["21"],["YES"]],[["48"],["NO"]],[["498"],["NO"]],[["499"],["NO"]],[["500"],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_64","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate long longs c, v0, v1, a, l\ndeclare input with no arguments, returning void\n read c read v0 read v1 read a read l\nend of the block\ndefine the main function\n run input\n create long long speed with speed = v0\n create long long cur with cur = 0\n create long long ans with ans = 0\n while cur is less than c\n if cur is true, decrement cur by l\n increment cur by speed\n set speed to minimum of speed + a and v1\n increment ans\n end of the block\n print ans print \"\\n\"\nend of the block\n\n[CODE]:","reference_output":"long long c, v0, v1, a, l;\nvoid input() {\n cin >> c >> v0 >> v1 >> a >> l;\n}\nint main() {\n input();\n long long speed = v0;\n long long cur = 0;\n long long ans = 0;\n while (cur < c) {\n if (cur) cur -= l;\n cur += speed;\n speed = min(speed + a, v1);\n ans++;\n }\n cout << ans << \"\\n\";\n}","item":{"problem_id":"820A","pseudocode":"create long longs c, v0, v1, a, l\ndeclare input with no arguments, returning void\n read c read v0 read v1 read a read l\nend of the block\ndefine the main function\n run input\n create long long speed with speed = v0\n create long long cur with cur = 0\n create long long ans with ans = 0\n while cur is less than c\n if cur is true, decrement cur by l\n increment cur by speed\n set speed to minimum of speed + a and v1\n increment ans\n end of the block\n print ans print \"\\n\"\nend of the block","testcases":[[["5 5 10 5 4"],["1"]],[["12 4 12 4 1"],["3"]],[["15 1 100 0 0"],["15"]],[["1 1 1 0 0"],["1"]],[["1000 999 1000 1000 998"],["2"]],[["1000 2 2 5 1"],["999"]],[["1000 1 1 1000 0"],["1000"]],[["737 41 74 12 11"],["13"]],[["1000 1000 1000 0 999"],["1"]],[["765 12 105 5 7"],["17"]],[["15 2 2 1000 0"],["8"]],[["1000 1 1000 1000 0"],["2"]],[["20 3 7 1 2"],["6"]],[["1000 500 500 1000 499"],["501"]],[["1 1000 1000 1000 0"],["1"]],[["1000 2 1000 56 0"],["7"]],[["1000 2 1000 802 0"],["3"]],[["16 1 8 2 0"],["4"]],[["20 6 10 2 2"],["3"]],[["8 2 12 4 1"],["3"]],[["8 6 13 2 5"],["2"]],[["70 4 20 87 0"],["5"]],[["97 8 13 234 5"],["13"]],[["16 4 23 8 3"],["3"]],[["65 7 22 7 4"],["5"]],[["93 10 18 11 7"],["9"]],[["86 13 19 15 9"],["9"]],[["333 17 50 10 16"],["12"]],[["881 16 55 10 12"],["23"]],[["528 11 84 3 9"],["19"]],[["896 2 184 8 1"],["16"]],[["236 10 930 9 8"],["8"]],[["784 1 550 14 0"],["12"]],[["506 1 10 4 0"],["53"]],[["460 1 3 2 0"],["154"]],[["701 1 3 1 0"],["235"]],[["100 49 50 1000 2"],["3"]],[["100 1 100 100 0"],["2"]],[["12 1 4 2 0"],["4"]],[["22 10 12 0 0"],["3"]],[["20 10 15 1 4"],["3"]],[["1000 5 10 1 4"],["169"]],[["1000 1 1000 1 0"],["45"]],[["4 1 2 2 0"],["3"]],[["1 5 5 1 1"],["1"]],[["19 10 11 0 2"],["3"]],[["1 2 3 0 0"],["1"]],[["10 1 4 10 0"],["4"]],[["20 3 100 1 1"],["5"]],[["1000 5 9 5 0"],["112"]],[["1 11 12 0 10"],["1"]],[["1 1 1 1 0"],["1"]],[["1000 1 20 1 0"],["60"]],[["9 1 4 2 0"],["4"]],[["129 2 3 4 0"],["44"]],[["4 2 2 0 1"],["3"]],[["1000 1 10 100 0"],["101"]],[["100 1 100 1 0"],["14"]],[["8 3 4 2 0"],["3"]],[["20 1 6 4 0"],["5"]],[["8 2 4 2 0"],["3"]],[["11 5 6 7 2"],["3"]],[["100 120 130 120 0"],["1"]],[["7 1 4 1 0"],["4"]],[["5 3 10 0 2"],["3"]],[["5 2 2 0 0"],["3"]],[["1000 10 1000 10 0"],["14"]],[["25 3 50 4 2"],["4"]],[["9 10 10 10 9"],["1"]],[["17 10 12 6 5"],["2"]],[["15 5 10 3 0"],["3"]],[["8 3 5 1 0"],["3"]],[["19 1 12 5 0"],["4"]],[["1000 10 1000 1 0"],["37"]],[["100 1 2 1000 0"],["51"]],[["20 10 11 1000 9"],["6"]],[["16 2 100 1 1"],["5"]],[["18 10 13 2 5"],["3"]],[["12 3 5 3 1"],["4"]],[["17 3 11 2 0"],["4"]],[["4 2 100 1 1"],["2"]],[["7 4 5 2 3"],["3"]],[["100 1 2 2 0"],["51"]],[["50 4 5 5 0"],["11"]],[["1 2 2 0 1"],["1"]],[["1000 2 3 10 1"],["500"]],[["500 10 500 1000 0"],["2"]],[["1000 4 12 1 0"],["87"]],[["18 10 13 1 5"],["3"]],[["7 3 6 2 2"],["3"]],[["15 5 100 1 2"],["4"]],[["100 1 10 1 0"],["15"]],[["8 2 7 5 1"],["2"]],[["11 2 4 1 1"],["5"]],[["1000 500 900 100 300"],["3"]],[["7 1 2 5 0"],["4"]],[["7 3 5 3 2"],["3"]],[["7 3 10 2 1"],["2"]],[["1000 501 510 1 499"],["50"]],[["1000 1 1000 2 0"],["32"]],[["1 5 5 0 0"],["1"]],[["18 10 15 1 5"],["3"]],[["100 4 1000 1 2"],["13"]],[["20 2 40 1 1"],["6"]],[["1 11 1000 100 1"],["1"]],[["6 4 4 1 2"],["2"]],[["8 3 5 3 1"],["3"]],[["10 5 7 1 2"],["3"]],[["400 100 198 1 99"],["25"]],[["3 1 2 5 0"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_65","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nset MAX to 100000\nset INF to 1000000001\ncreate int a[MAX]\ncreate integers n, s ans sum, set sum to 0\ndefine the main function\n let count and temp be int, set count to 0\n read n\n for i=0 to n exclusive\n read temp\n assign temp to a[temp]\n end of the block\n for i=1 to 601 inclusive\n if a[i] different from 0, increment count\n print count\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int MAX = 100000;\nconst int INF = 1000000001;\nint a[MAX];\nint n, s, sum = 0;\nint main() {\n int count = 0, temp;\n cin >> n;\n for (int i = 0; i < n; ++i) {\n cin >> temp;\n a[temp] = temp;\n }\n for (int i = 1; i <= 601; ++i)\n if (a[i]) count++;\n cout << count << endl;\n return 0;\n}","item":{"problem_id":"937A","pseudocode":"set MAX to 100000\nset INF to 1000000001\ncreate int a[MAX]\ncreate integers n, s ans sum, set sum to 0\ndefine the main function\n let count and temp be int, set count to 0\n read n\n for i=0 to n exclusive\n read temp\n assign temp to a[temp]\n end of the block\n for i=1 to 601 inclusive\n if a[i] different from 0, increment count\n print count\n return to indicate successful execution\nend of the block","testcases":[[["4","1 3 3 2"],["3"]],[["3","1 1 1"],["1"]],[["4","42 0 0 42"],["1"]],[["10","1 0 1 0 1 0 0 0 0 1"],["1"]],[["10","572 471 540 163 50 30 561 510 43 200"],["10"]],[["100","122 575 426 445 172 81 247 429 97 202 175 325 382 384 417 356 132 502 328 537 57 339 518 211 479 306 140 168 268 16 140 263 593 249 391 310 555 468 231 180 157 18 334 328 276 155 21 280 322 545 111 267 467 274 291 304 235 34 365 180 21 95 501 552 325 331 302 353 296 22 289 399 7 466 32 302 568 333 75 192 284 10 94 128 154 512 9 480 243 521 551 492 420 197 207 125 367 117 438 600"],["94"]],[["100","600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600"],["1"]],[["78","5 4 13 2 5 6 2 10 10 1 2 6 7 9 6 3 5 7 1 10 2 2 7 0 2 11 11 3 1 13 3 10 6 2 0 3 0 5 0 1 4 11 1 1 7 0 12 7 5 12 0 2 12 9 8 3 4 3 4 11 4 10 2 3 10 12 5 6 1 11 2 0 8 7 9 1 3 12"],["13"]],[["34","220 387 408 343 184 447 197 307 337 414 251 319 426 322 347 242 208 412 188 185 241 235 216 259 331 372 322 284 444 384 214 297 389 391"],["33"]],[["100","1 2 1 0 3 0 2 0 0 1 2 0 1 3 0 3 3 1 3 0 0 2 1 2 2 1 3 3 3 3 3 2 0 0 2 1 2 3 2 3 0 1 1 3 3 2 0 3 1 0 2 2 2 1 2 3 2 1 0 3 0 2 0 3 0 2 1 0 3 1 0 2 2 1 3 1 3 0 2 3 3 1 1 3 1 3 0 3 2 0 2 3 3 0 2 0 2 0 1 3"],["3"]],[["100","572 471 540 163 50 30 561 510 43 200 213 387 500 424 113 487 357 333 294 337 435 202 447 494 485 465 161 344 470 559 104 356 393 207 224 213 511 514 60 386 149 216 392 229 429 173 165 401 395 150 127 579 344 390 529 296 225 425 318 79 465 447 177 110 367 212 459 270 41 500 277 567 125 436 178 9 214 342 203 112 144 24 79 155 495 556 40 549 463 281 241 316 2 246 1 396 510 293 332 55"],["93"]],[["99","5 4 13 2 5 6 2 10 10 1 2 6 7 9 6 3 5 7 1 10 2 2 7 0 2 11 11 3 1 13 3 10 6 2 0 3 0 5 0 1 4 11 1 1 7 0 12 7 5 12 0 2 12 9 8 3 4 3 4 11 4 10 2 3 10 12 5 6 1 11 2 0 8 7 9 1 3 12 2 3 9 3 7 13 7 13 0 11 8 12 2 5 9 4 0 6 6 2 13"],["13"]],[["99","1 0 1 0 1 0 0 0 0 1 0 0 1 1 0 1 1 1 1 0 0 0 1 0 0 1 1 1 1 1 1 0 0 0 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 0 0 0 0 0 1"],["1"]],[["99","21 74 25 44 71 80 46 28 96 1 74 24 81 83 16 55 31 1 27 36 56 38 17 10 78 5 39 67 67 15 39 62 92 48 90 9 54 67 30 79 56 17 33 27 75 54 20 79 21 44 10 66 66 73 90 3 34 33 64 79 20 94 0 51 24 30 1 52 95 21 88 98 6 65 31 1 67 32 74 91 83 9 93 27 53 11 8 79 42 20 50 91 19 96 6 24 66 16 37"],["61"]],[["2","0 1"],["1"]],[["2","0 600"],["1"]],[["4","1 1 1 2"],["2"]],[["4","0 0 1 2"],["2"]],[["1","5"],["1"]],[["2","0 5"],["1"]],[["5","1 0 0 1 2"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_66","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integer t\n let a, b and k be long long variables\n create long long ans\n read t\n for t iterations\n read a, b and k\n set ans to 0\n create bool even = true\n if k is even\n set ans to k \/ 2 * (a - b)\n else\n set ans to k \/ 2 * (a - b) + a\n print ans\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int t;\n long long a, b, k;\n long long ans;\n cin >> t;\n while (t--) {\n cin >> a >> b >> k;\n ans = 0;\n bool even = true;\n if (k % 2 == 0)\n ans = k \/ 2 * (a - b);\n else\n ans = k \/ 2 * (a - b) + a;\n cout << ans << endl;\n }\n return 0;\n}","item":{"problem_id":"1077A","pseudocode":"define the main function\n create integer t\n let a, b and k be long long variables\n create long long ans\n read t\n for t iterations\n read a, b and k\n set ans to 0\n create bool even = true\n if k is even\n set ans to k \/ 2 * (a - b)\n else\n set ans to k \/ 2 * (a - b) + a\n print ans\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["6","5 2 3","100 1 4","1 10 5","1000000000 1 6","1 1 1000000000","1 1 999999999"],["8","198","-17","2999999997","0","1"]],[["1","19280817 1 1"],["19280817"]],[["1","598 56 799"],["216856"]],[["1","599 56 799"],["217256"]],[["16","602436426 877914575 158260522","623690081 861648772 24979445","262703497 476190629 433933447","628894325 971407775 211047202","450968417 822804784 731963982","161735902 982631932 430302156","707723857 923078537 880895728","802329211 910286918 189330739","317063340 303238506 404539679","125660016 773361868 492686568","462224593 839296263 650287940","191890310 384836991 492601449","404011431 782177068 576823355","160449218 954291757 818008580","164163676 840594328 155374934","501899080 138996221 797829355"],["-21798657830166889","-2972037274383821","-46319603170004939","-36143252634933450","-136085413920866697","-176616665780420340","-94852508808403520","-10219855367219672","2796347264445066","-159557001274561968","-122602579758329900","-47522907031806734","-109067385146931818","-324685004035492310","-52550183955038484","144767277282260623"]],[["70","1 1 1","1 1 2","1 1 3","1 1 4","1 1 5","1 1 6","1 1 7","1 1 8","1 1 9","1 1 10","1 2 1","1 2 2","1 2 3","1 2 4","1 2 5","1 2 6","1 2 7","1 2 8","1 2 9","1 2 10","1 3 1","1 3 2","1 3 3","1 3 4","1 3 5","1 3 6","1 3 7","1 3 8","1 3 9","1 3 10","1 4 1","1 4 2","1 4 3","1 4 4","1 4 5","1 4 6","1 4 7","1 4 8","1 4 9","1 4 10","1 5 1","1 5 2","1 5 3","1 5 4","1 5 5","1 5 6","1 5 7","1 5 8","1 5 9","1 5 10","1 6 1","1 6 2","1 6 3","1 6 4","1 6 5","1 6 6","1 6 7","1 6 8","1 6 9","1 6 10","1 7 1","1 7 2","1 7 3","1 7 4","1 7 5","1 7 6","1 7 7","1 7 8","1 7 9","1 7 10"],["1","0","1","0","1","0","1","0","1","0","1","-1","0","-2","-1","-3","-2","-4","-3","-5","1","-2","-1","-4","-3","-6","-5","-8","-7","-10","1","-3","-2","-6","-5","-9","-8","-12","-11","-15","1","-4","-3","-8","-7","-12","-11","-16","-15","-20","1","-5","-4","-10","-9","-15","-14","-20","-19","-25","1","-6","-5","-12","-11","-18","-17","-24","-23","-30"]],[["30","1 1 1000000000","1 1 999999999","1 1 999999998","1 1 999999997","1 1 999999996","1 1 999999995","1 1 999999994","1 1 999999993","1 1 999999992","1 1 999999991","1 2 1000000000","1 2 999999999","1 2 999999998","1 2 999999997","1 2 999999996","1 2 999999995","1 2 999999994","1 2 999999993","1 2 999999992","1 2 999999991","1 3 1000000000","1 3 999999999","1 3 999999998","1 3 999999997","1 3 999999996","1 3 999999995","1 3 999999994","1 3 999999993","1 3 999999992","1 3 999999991"],["0","1","0","1","0","1","0","1","0","1","-500000000","-499999998","-499999999","-499999997","-499999998","-499999996","-499999997","-499999995","-499999996","-499999994","-1000000000","-999999997","-999999998","-999999995","-999999996","-999999993","-999999994","-999999991","-999999992","-999999989"]],[["30","1 1000000000 1","1 1000000000 2","1 1000000000 3","1 1000000000 4","1 1000000000 5","1 1000000000 6","1 1000000000 7","1 1000000000 8","1 1000000000 9","1 1000000000 10","1 999999999 1","1 999999999 2","1 999999999 3","1 999999999 4","1 999999999 5","1 999999999 6","1 999999999 7","1 999999999 8","1 999999999 9","1 999999999 10","1 999999998 1","1 999999998 2","1 999999998 3","1 999999998 4","1 999999998 5","1 999999998 6","1 999999998 7","1 999999998 8","1 999999998 9","1 999999998 10"],["1","-999999999","-999999998","-1999999998","-1999999997","-2999999997","-2999999996","-3999999996","-3999999995","-4999999995","1","-999999998","-999999997","-1999999996","-1999999995","-2999999994","-2999999993","-3999999992","-3999999991","-4999999990","1","-999999997","-999999996","-1999999994","-1999999993","-2999999991","-2999999990","-3999999988","-3999999987","-4999999985"]],[["30","1000000000 1 1","1000000000 1 2","1000000000 1 3","1000000000 1 4","1000000000 1 5","1000000000 1 6","1000000000 1 7","1000000000 1 8","1000000000 1 9","1000000000 1 10","1000000000 2 1","1000000000 2 2","1000000000 2 3","1000000000 2 4","1000000000 2 5","1000000000 2 6","1000000000 2 7","1000000000 2 8","1000000000 2 9","1000000000 2 10","1000000000 3 1","1000000000 3 2","1000000000 3 3","1000000000 3 4","1000000000 3 5","1000000000 3 6","1000000000 3 7","1000000000 3 8","1000000000 3 9","1000000000 3 10"],["1000000000","999999999","1999999999","1999999998","2999999998","2999999997","3999999997","3999999996","4999999996","4999999995","1000000000","999999998","1999999998","1999999996","2999999996","2999999994","3999999994","3999999992","4999999992","4999999990","1000000000","999999997","1999999997","1999999994","2999999994","2999999991","3999999991","3999999988","4999999988","4999999985"]],[["20","1000000000 1 1000000000","1000000000 1 999999999","1000000000 1 999999998","1000000000 1 999999997","1000000000 1 999999996","1000000000 1 999999995","1000000000 1 999999994","1000000000 1 999999993","1000000000 1 999999992","1000000000 1 999999991","1000000000 2 1000000000","1000000000 2 999999999","1000000000 2 999999998","1000000000 2 999999997","1000000000 2 999999996","1000000000 2 999999995","1000000000 2 999999994","1000000000 2 999999993","1000000000 2 999999992","1000000000 2 999999991"],["499999999500000000","499999999500000001","499999998500000001","499999998500000002","499999997500000002","499999997500000003","499999996500000003","499999996500000004","499999995500000004","499999995500000005","499999999000000000","499999999000000002","499999998000000002","499999998000000004","499999997000000004","499999997000000006","499999996000000006","499999996000000008","499999995000000008","499999995000000010"]],[["20","1000000000 1000000000 1","1000000000 1000000000 2","1000000000 1000000000 3","1000000000 1000000000 4","1000000000 1000000000 5","1000000000 1000000000 6","1000000000 1000000000 7","1000000000 1000000000 8","1000000000 1000000000 9","1000000000 1000000000 10","1000000000 999999999 1","1000000000 999999999 2","1000000000 999999999 3","1000000000 999999999 4","1000000000 999999999 5","1000000000 999999999 6","1000000000 999999999 7","1000000000 999999999 8","1000000000 999999999 9","1000000000 999999999 10"],["1000000000","0","1000000000","0","1000000000","0","1000000000","0","1000000000","0","1000000000","1","1000000001","2","1000000002","3","1000000003","4","1000000004","5"]]]}} +{"instance_id":"pseudo_to_code_0.5k_67","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integer variable called n\n read n\n let a be an array of characters of size 60\n read a\n j is integer = 1\n for i = 0 to n exclusive, incrementing i by j\n print a[i]\n increase j by one\n end of the block\n print new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n char a[60];\n cin >> a;\n int j = 1;\n for (int i = 0; i < n; i = i + j) {\n cout << a[i];\n j++;\n }\n cout << endl;\n return 0;\n}","item":{"problem_id":"1095A","pseudocode":"define the main function\n declare integer variable called n\n read n\n let a be an array of characters of size 60\n read a\n j is integer = 1\n for i = 0 to n exclusive, incrementing i by j\n print a[i]\n increase j by one\n end of the block\n print new line\n return to indicate successful execution\nend of the block","testcases":[[["6","baabbb"],["bab"]],[["10","ooopppssss"],["oops"]],[["1","z"],["z"]],[["3","zww"],["zw"]],[["55","cooooonnnnttttteeeeeeeeeeeeessssssssttttttttttttttttttt"],["coonteestt"]],[["21","coodddeeeecccccoooooo"],["codeco"]],[["55","aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"],["aaaaaaaaaa"]],[["36","abbcccddddeeeeeffffffggggggghhhhhhhh"],["abcdefgh"]]]}} +{"instance_id":"pseudo_to_code_0.5k_68","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, k = integers\n read n\n for a = 1 to n \/ 2\n k = n \/ 2 - a + 1\n for j = 1 to k, print *\n for j = 1 to n - k * 2, print D\n for j = 1 to k, print *\n print new line\n end of the block\n for a = 1 to n, print D\n print new line\n for a = 1 to n \/ 2\n for j = 1 to a, print *\n for j = 1 to n - a * 2, print D\n for j = 1 to a, print *\n print new line\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, k;\n cin >> n;\n for (int a = 1; a <= n \/ 2; ++a) {\n k = n \/ 2 - a + 1;\n for (int j = 1; j <= k; ++j) cout << \"*\";\n for (int j = 1; j <= n - k * 2; ++j) cout << \"D\";\n for (int j = 1; j <= k; ++j) cout << \"*\";\n cout << endl;\n }\n for (int a = 1; a <= n; ++a) cout << \"D\";\n cout << endl;\n for (int a = 1; a <= n \/ 2; ++a) {\n for (int j = 1; j <= a; ++j) cout << \"*\";\n for (int j = 1; j <= n - a * 2; ++j) cout << \"D\";\n for (int j = 1; j <= a; ++j) cout << \"*\";\n cout << endl;\n }\n}","item":{"problem_id":"454A","pseudocode":"define the main function\n n, k = integers\n read n\n for a = 1 to n \/ 2\n k = n \/ 2 - a + 1\n for j = 1 to k, print *\n for j = 1 to n - k * 2, print D\n for j = 1 to k, print *\n print new line\n end of the block\n for a = 1 to n, print D\n print new line\n for a = 1 to n \/ 2\n for j = 1 to a, print *\n for j = 1 to n - a * 2, print D\n for j = 1 to a, print *\n print new line\n end of the block\nend of the block","testcases":[[["3"],["*D*","DDD","*D*"]],[["5"],["**D**","*DDD*","DDDDD","*DDD*","**D**"]],[["7"],["***D***","**DDD**","*DDDDD*","DDDDDDD","*DDDDD*","**DDD**","***D***"]],[["11"],["*****D*****","****DDD****","***DDDDD***","**DDDDDDD**","*DDDDDDDDD*","DDDDDDDDDDD","*DDDDDDDDD*","**DDDDDDD**","***DDDDD***","****DDD****","*****D*****"]],[["15"],["*******D*******","******DDD******","*****DDDDD*****","****DDDDDDD****","***DDDDDDDDD***","**DDDDDDDDDDD**","*DDDDDDDDDDDDD*","DDDDDDDDDDDDDDD","*DDDDDDDDDDDDD*","**DDDDDDDDDDD**","***DDDDDDDDD***","****DDDDDDD****","*****DDDDD*****","******DDD******","*******D*******"]],[["21"],["**********D**********","*********DDD*********","********DDDDD********","*******DDDDDDD*******","******DDDDDDDDD******","*****DDDDDDDDDDD*****","****DDDDDDDDDDDDD****","***DDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDD***","****DDDDDDDDDDDDD****","*****DDDDDDDDDDD*****","******DDDDDDDDD******","*******DDDDDDD*******","********DDDDD********","*********DDD*********","**********D**********"]],[["27"],["*************D*************","************DDD************","***********DDDDD***********","**********DDDDDDD**********","*********DDDDDDDDD*********","********DDDDDDDDDDD********","*******DDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDD*******","********DDDDDDDDDDD********","*********DDDDDDDDD*********","**********DDDDDDD**********","***********DDDDD***********","************DDD************","*************D*************"]],[["35"],["*****************D*****************","****************DDD****************","***************DDDDD***************","**************DDDDDDD**************","*************DDDDDDDDD*************","************DDDDDDDDDDD************","***********DDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDD***********","************DDDDDDDDDDD************","*************DDDDDDDDD*************","**************DDDDDDD**************","***************DDDDD***************","****************DDD****************","*****************D*****************"]],[["49"],["************************D************************","***********************DDD***********************","**********************DDDDD**********************","*********************DDDDDDD*********************","********************DDDDDDDDD********************","*******************DDDDDDDDDDD*******************","******************DDDDDDDDDDDDD******************","*****************DDDDDDDDDDDDDDD*****************","****************DDDDDDDDDDDDDDDDD****************","***************DDDDDDDDDDDDDDDDDDD***************","**************DDDDDDDDDDDDDDDDDDDDD**************","*************DDDDDDDDDDDDDDDDDDDDDDD*************","************DDDDDDDDDDDDDDDDDDDDDDDDD************","***********DDDDDDDDDDDDDDDDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDDDDDDDDDDDDDDDD***********","************DDDDDDDDDDDDDDDDDDDDDDDDD************","*************DDDDDDDDDDDDDDDDDDDDDDD*************","**************DDDDDDDDDDDDDDDDDDDDD**************","***************DDDDDDDDDDDDDDDDDDD***************","****************DDDDDDDDDDDDDDDDD****************","*****************DDDDDDDDDDDDDDD*****************","******************DDDDDDDDDDDDD******************","*******************DDDDDDDDDDD*******************","********************DDDDDDDDD********************","*********************DDDDDDD*********************","**********************DDDDD**********************","***********************DDD***********************","************************D************************"]],[["51"],["*************************D*************************","************************DDD************************","***********************DDDDD***********************","**********************DDDDDDD**********************","*********************DDDDDDDDD*********************","********************DDDDDDDDDDD********************","*******************DDDDDDDDDDDDD*******************","******************DDDDDDDDDDDDDDD******************","*****************DDDDDDDDDDDDDDDDD*****************","****************DDDDDDDDDDDDDDDDDDD****************","***************DDDDDDDDDDDDDDDDDDDDD***************","**************DDDDDDDDDDDDDDDDDDDDDDD**************","*************DDDDDDDDDDDDDDDDDDDDDDDDD*************","************DDDDDDDDDDDDDDDDDDDDDDDDDDD************","***********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***********","************DDDDDDDDDDDDDDDDDDDDDDDDDDD************","*************DDDDDDDDDDDDDDDDDDDDDDDDD*************","**************DDDDDDDDDDDDDDDDDDDDDDD**************","***************DDDDDDDDDDDDDDDDDDDDD***************","****************DDDDDDDDDDDDDDDDDDD****************","*****************DDDDDDDDDDDDDDDDD*****************","******************DDDDDDDDDDDDDDD******************","*******************DDDDDDDDDDDDD*******************","********************DDDDDDDDDDD********************","*********************DDDDDDDDD*********************","**********************DDDDDDD**********************","***********************DDDDD***********************","************************DDD************************","*************************D*************************"]]]}} +{"instance_id":"pseudo_to_code_0.5k_69","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n ley arr = array of booleans of size 505\n tambah = integer with value 1\n set first 500 elements of arr to 0\n loop i from 1 to 500 inclusive increasing by value of tambah\n set arr[i] to 1\n increase tambah\n end of the block\n create integer n\n read n\n if arr[n] exists\n print and \"YES\\n\"\n else\n print \"NO\\n\"\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n bool arr[505];\n int tambah = 1;\n for (int i = 0; i <= 500; i++) { arr[i] = 0; }\n for (int i = 1; i <= 500; i += tambah) {\n arr[i] = 1;\n tambah++;\n }\n int n;\n cin >> n;\n if (arr[n])\n cout << \"YES\\n\";\n else\n cout << \"NO\\n\";\n return 0;\n}","item":{"problem_id":"47A","pseudocode":"define the main function\n ley arr = array of booleans of size 505\n tambah = integer with value 1\n set first 500 elements of arr to 0\n loop i from 1 to 500 inclusive increasing by value of tambah\n set arr[i] to 1\n increase tambah\n end of the block\n create integer n\n read n\n if arr[n] exists\n print and \"YES\\n\"\n else\n print \"NO\\n\"\n return to indicate successful execution\nend of the block","testcases":[[["1"],["YES"]],[["2"],["NO"]],[["3"],["YES"]],[["4"],["NO"]],[["5"],["NO"]],[["6"],["YES"]],[["7"],["NO"]],[["8"],["NO"]],[["12"],["NO"]],[["10"],["YES"]],[["11"],["NO"]],[["9"],["NO"]],[["14"],["NO"]],[["15"],["YES"]],[["16"],["NO"]],[["20"],["NO"]],[["21"],["YES"]],[["22"],["NO"]],[["121"],["NO"]],[["135"],["NO"]],[["136"],["YES"]],[["137"],["NO"]],[["152"],["NO"]],[["153"],["YES"]],[["154"],["NO"]],[["171"],["YES"]],[["189"],["NO"]],[["190"],["YES"]],[["191"],["NO"]],[["210"],["YES"]],[["211"],["NO"]],[["231"],["YES"]],[["232"],["NO"]],[["252"],["NO"]],[["253"],["YES"]],[["254"],["NO"]],[["275"],["NO"]],[["276"],["YES"]],[["277"],["NO"]],[["299"],["NO"]],[["300"],["YES"]],[["301"],["NO"]],[["324"],["NO"]],[["325"],["YES"]],[["326"],["NO"]],[["350"],["NO"]],[["351"],["YES"]],[["352"],["NO"]],[["377"],["NO"]],[["378"],["YES"]],[["406"],["YES"]],[["434"],["NO"]],[["435"],["YES"]],[["464"],["NO"]],[["465"],["YES"]],[["495"],["NO"]],[["496"],["YES"]],[["497"],["NO"]],[["331"],["NO"]],[["413"],["NO"]],[["177"],["NO"]],[["122"],["NO"]],[["478"],["NO"]],[["188"],["NO"]],[["21"],["YES"]],[["474"],["NO"]],[["21"],["YES"]],[["48"],["NO"]],[["498"],["NO"]],[["499"],["NO"]],[["500"],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_70","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n winner, spectator are integers\n n is an integer\n while read n\n flag equals boolean true\n spectator equals 3\n for integer i = 0 to n exclusive\n read winner\n if winner equals spectator\n flag equals false\n else\n i is an integer equal to 1\n while i equals winner or spectator\n spectator equals i\n end of the block\n end of the block\n if flag equals 0\n print YES and endline\n else\n print NO and endline\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int winner, spectator;\n int n;\n while (cin >> n) {\n bool flag = true;\n spectator = 3;\n for (int i = 0; i < n; i++) {\n cin >> winner;\n if (winner == spectator)\n flag = false;\n else {\n int i = 1;\n while (i == winner || i == spectator) i++;\n spectator = i;\n }\n }\n if (flag)\n cout << \"YES\" << endl;\n else\n cout << \"NO\" << endl;\n }\n}","item":{"problem_id":"893A","pseudocode":"define the main function\n winner, spectator are integers\n n is an integer\n while read n\n flag equals boolean true\n spectator equals 3\n for integer i = 0 to n exclusive\n read winner\n if winner equals spectator\n flag equals false\n else\n i is an integer equal to 1\n while i equals winner or spectator\n spectator equals i\n end of the block\n end of the block\n if flag equals 0\n print YES and endline\n else\n print NO and endline\n end of the block\nend of the block","testcases":[[["3","1","1","2"],["YES"]],[["2","1","2"],["NO"]],[["100","2","3","1","2","3","3","3","1","1","1","1","3","3","3","3","1","2","3","3","3","3","3","3","3","1","2","2","2","3","1","1","3","3","3","3","3","3","3","3","1","2","3","3","3","1","1","1","1","3","3","3","3","1","2","3","1","2","2","2","3","3","2","1","3","3","1","2","3","1","1","1","2","2","2","3","1","1","1","1","1","1","3","2","2","2","2","2","2","3","1","2","2","2","2","2","3","3","2","1","1"],["YES"]],[["99","1","3","2","2","3","1","1","3","3","3","3","3","3","1","1","3","3","3","3","1","1","3","2","1","1","1","1","1","1","1","3","2","2","2","1","3","3","1","1","3","2","1","3","3","1","2","3","3","3","1","2","2","2","3","3","3","3","3","3","2","2","2","2","3","3","3","1","1","3","2","1","1","2","2","2","3","3","2","1","1","2","2","1","3","2","1","1","2","3","3","3","3","2","2","2","2","2","1","3"],["YES"]],[["100","2","2","1","3","1","3","3","1","1","3","1","1","3","2","1","3","1","1","3","3","2","2","3","1","1","2","3","2","2","3","1","1","2","3","2","1","2","2","3","3","1","1","3","1","2","1","3","1","1","3","2","2","2","1","1","1","3","1","3","2","1","2","2","2","3","3","2","1","1","3","3","2","1","2","1","1","3","1","2","3","2","3","3","3","2","2","1","3","1","2","3","1","2","3","3","1","2","1","3","1"],["NO"]],[["10","2","3","3","3","3","2","2","2","3","2"],["NO"]],[["100","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1"],["YES"]],[["1","3"],["NO"]],[["1","2"],["YES"]],[["42","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1"],["YES"]],[["4","2","3","3","3"],["YES"]],[["3","1","2","3"],["NO"]],[["5","1","1","1","1","3"],["NO"]],[["5","2","3","3","3","3"],["YES"]],[["2","3","3"],["NO"]],[["4","1","2","2","1"],["NO"]],[["3","2","2","3"],["NO"]],[["5","2","3","3","1","1"],["NO"]],[["3","3","1","3"],["NO"]],[["3","3","3","1"],["NO"]],[["2","2","1"],["NO"]],[["3","1","1","3"],["NO"]],[["6","2","2","2","3","1","3"],["NO"]],[["2","3","1"],["NO"]],[["2","3","2"],["NO"]],[["2","1","3"],["YES"]],[["3","1","3","1"],["NO"]],[["5","1","1","2","2","3"],["NO"]],[["3","2","1","1"],["NO"]],[["2","2","2"],["YES"]],[["3","2","2","1"],["YES"]],[["5","2","2","2","2","2"],["YES"]],[["8","1","1","1","1","1","1","1","1"],["YES"]],[["3","3","2","2"],["NO"]],[["3","3","2","3"],["NO"]],[["7","2","2","2","2","2","2","2"],["YES"]],[["3","2","2","2"],["YES"]]]}} +{"instance_id":"pseudo_to_code_0.5k_71","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndebug = int with debug = 1\nmod = const int with mod = 1e9 + 7\nin function is_big taking char a and returning bool\n if a >= 'A' and a <= 'Z' return true\n return false\nend of the block\nin function solve\n n = int\n read n\n str = string\n read str\n read str\n maxx, now = int with maxx = 0 and now = 0\n for i = 0 to length of str as int\n if str[i] is 32\n set maxx to max of maxx, now\n set now to 0\n end of the block\n if is_big if str[i] increment now\n end of the block\n set maxx to max of maxx, now\n print maxx\nend of the block\ndefine the main function\n t = int with t = 1\n loop t times call solve\nend of the block\n\n[CODE]:","reference_output":"int debug = 1;\nconst int mod = 1e9 + 7;\nbool is_big(char a) {\n if (a >= 'A' and a <= 'Z') return true;\n return false;\n}\nvoid solve() {\n int n;\n cin >> n;\n string str;\n getline(cin, str);\n getline(cin, str);\n int maxx = 0, now = 0;\n for (int i = 0; i < (int)str.length(); i++) {\n if (str[i] == 32) {\n maxx = max(maxx, now);\n now = 0;\n }\n if (is_big(str[i])) { now++; }\n }\n maxx = max(maxx, now);\n cout << maxx << endl;\n}\nint main() {\n int t = 1;\n while (t--) solve();\n}","item":{"problem_id":"837A","pseudocode":"debug = int with debug = 1\nmod = const int with mod = 1e9 + 7\nin function is_big taking char a and returning bool\n if a >= 'A' and a <= 'Z' return true\n return false\nend of the block\nin function solve\n n = int\n read n\n str = string\n read str\n read str\n maxx, now = int with maxx = 0 and now = 0\n for i = 0 to length of str as int\n if str[i] is 32\n set maxx to max of maxx, now\n set now to 0\n end of the block\n if is_big if str[i] increment now\n end of the block\n set maxx to max of maxx, now\n print maxx\nend of the block\ndefine the main function\n t = int with t = 1\n loop t times call solve\nend of the block","testcases":[[["7","NonZERO"],["5"]],[["24","this is zero answer text"],["0"]],[["24","Harbour Space University"],["1"]],[["2","WM"],["2"]],[["200","LBmJKQLCKUgtTxMoDsEerwvLOXsxASSydOqWyULsRcjMYDWdDCgaDvBfATIWPVSXlbcCLHPYahhxMEYUiaxoCebghJqvmRnaNHYTKLeOiaLDnATPZAOgSNfBzaxLymTGjfzvTegbXsAthTxyDTcmBUkqyGlVGZhoazQzVSoKbTFcCRvYsgSCwjGMxBfWEwMHuagTBxkz"],["105"]],[["199","o A r v H e J q k J k v w Q F p O R y R Z o a K R L Z E H t X y X N y y p b x B m r R S q i A x V S u i c L y M n N X c C W Z m S j e w C w T r I S X T D F l w o k f t X u n W w p Z r A k I Y E h s g"],["1"]],[["200","hCyIdivIiISmmYIsCLbpKcTyHaOgTUQEwnQACXnrLdHAVFLtvliTEMlzBVzTesQbhXmcqvwPDeojglBMIjOXANfyQxCSjOJyO SIqOTnRzVzseGIDDYNtrwIusScWSuEhPyEmgQIVEzXofRptjeMzzhtUQxJgcUWILUhEaaRmYRBVsjoqgmyPIKwSajdlNPccOOtWrez"],["50"]],[["1","e"],["0"]],[["1","A"],["1"]],[["200","ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ ABCDEFGHIJ KLMNOPRSTU KLMNOPRSTU KLMNOPRSTU VWXYZABCDE KLMNOPRSTU KLMNOPRSTU KLMNOPRSTU KLMNOPRSTU KZ"],["10"]],[["200","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"],["200"]],[["200","ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"],["0"]],[["24","Harbour Space UniversitY"],["2"]],[["5","aA AA"],["2"]],[["10","as AS ASDA"],["4"]],[["10","as AS ASDZ"],["4"]],[["3","a A"],["1"]],[["24","Harbour space UniversitY"],["2"]],[["10","as AS ASAa"],["3"]],[["15","aAb ABCDFGRHTJS"],["11"]],[["53","sdfAZEZR AZE dfdf dsdRFGSDF ZZDZSD dfsd ERBGF dsfsdfR"],["6"]],[["10","ABC ABc AB"],["3"]],[["10","A c de CDE"],["3"]],[["4","A AB"],["2"]],[["18","HARbour Space UNIV"],["4"]],[["13","a b c d e f A"],["1"]],[["6","A B CA"],["2"]],[["4","aa A"],["1"]],[["3","A a"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_72","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integers i, j, m, a, s, d, c, b, n, x, p = 0, y, k = 0, integer arrays an size 1001, am size 1001\n read n and m\n for i = 0 to n exclusive, read an[i]\n for j = 0 to m exclusive, read am[j]\n for i = 0, j = 0 to n exclusive\n if am[j] is greater than or equal to an[i]\n increment k\n increment j\n end of the block\n end of the block\n if k is greater than m\n print m and newline\n else\n print k and newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int i, j, m, a, s, d, c, b, n, x, p = 0, y, k = 0, an[1001], am[1001];\n cin >> n >> m;\n for (i = 0; i < n; i++) { cin >> an[i]; }\n for (j = 0; j < m; j++) { cin >> am[j]; }\n for (i = 0, j = 0; i < n; i++) {\n if (am[j] >= an[i]) {\n k++;\n j++;\n }\n }\n if (k > m)\n cout << m << endl;\n else\n cout << k << endl;\n return 0;\n}","item":{"problem_id":"1009A","pseudocode":"define the main function\n declare integers i, j, m, a, s, d, c, b, n, x, p = 0, y, k = 0, integer arrays an size 1001, am size 1001\n read n and m\n for i = 0 to n exclusive, read an[i]\n for j = 0 to m exclusive, read am[j]\n for i = 0, j = 0 to n exclusive\n if am[j] is greater than or equal to an[i]\n increment k\n increment j\n end of the block\n end of the block\n if k is greater than m\n print m and newline\n else\n print k and newline\n return to indicate successful execution\nend of the block","testcases":[[["5 4","2 4 5 2 4","5 3 4 6"],["3"]],[["5 2","20 40 50 20 40","19 20"],["0"]],[["6 4","4 8 15 16 23 42","1000 1000 1000 1000"],["4"]],[["5 1","1 1 1 1 1","5"],["1"]],[["5 1","10 1 1 1 1","1000"],["1"]],[["5 1","100 100 100 100 100","100"],["1"]],[["2 1","2 1","1"],["1"]],[["2 3","3 1","2 4 2"],["1"]],[["1 5","4","1 4 3 3 2"],["0"]],[["5 3","4 2 3 1 1","2 1 3"],["3"]],[["3 5","5 2 5","1 4 1 4 2"],["0"]],[["7 3","9 7 10 2 1 1 1","8 9 6"],["3"]],[["5 3","2 5 3 3 2","2 5 3"],["3"]]]}} +{"instance_id":"pseudo_to_code_0.5k_73","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nn, d, x, i, t = integers, a = array of integers of size 2010\ndefine the main function\n read n and d\n for i from 0 to n\n read a[i]\n set t to 0 if a[i] > a[i - 1], otherwise set to (a[i - 1] - a[i]) \/ d + 1\n increase x by t\n increase a[i] by t * d\n end of the block\n print x and a new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int n, d, x, a[2010], i, t;\nint main() {\n cin >> n >> d;\n for (i - 0; i < n; i++) {\n cin >> a[i];\n t = a[i] > a[i - 1] ? 0 : (a[i - 1] - a[i]) \/ d + 1;\n x += t;\n a[i] += t * d;\n }\n cout << x << endl;\n return 0;\n}","item":{"problem_id":"11A","pseudocode":"n, d, x, i, t = integers, a = array of integers of size 2010\ndefine the main function\n read n and d\n for i from 0 to n\n read a[i]\n set t to 0 if a[i] > a[i - 1], otherwise set to (a[i - 1] - a[i]) \/ d + 1\n increase x by t\n increase a[i] by t * d\n end of the block\n print x and a new line\n return to indicate successful execution\nend of the block","testcases":[[["4 2","1 3 3 2"],["3"]],[["2 1","1 1"],["1"]],[["2 1","2 5"],["0"]],[["2 1","1 2"],["0"]],[["2 1","1 1"],["1"]],[["2 7","10 20"],["0"]],[["2 7","1 1"],["1"]],[["3 3","18 1 9"],["10"]],[["3 3","15 17 9"],["3"]],[["3 3","10 9 12"],["2"]],[["10 3","2 1 17 10 5 16 8 4 15 17"],["31"]],[["10 3","6 11 4 12 22 15 23 26 24 26"],["13"]],[["10 3","10 24 13 15 18 14 15 26 33 35"],["29"]],[["100 3","529 178 280 403 326 531 671 427 188 866 669 646 421 804 494 609 53 1012 211 243 887 833 900 543 226 42 859 718 454 372 971 692 846 770 511 395 499 479 641 756 115 269 206 45 1039 727 400 779 859 614 146 214 196 919 702 959 380 830 535 878 859 784 316 305 782 924 536 243 236 978 564 150 291 877 808 983 537 839 490 120 168 838 267 650 900 170 211 504 326 771 895 984 994 483 776 100 471 1078 317 580"],["15717"]],[["100 3","329 226 331 909 962 112 837 1005 194 818 506 416 125 648 367 459 400 582 989 547 329 438 234 121 272 226 821 376 834 427 718 164 834 113 654 177 737 212 169 696 744 180 89 944 233 147 667 990 809 1072 1085 1093 814 265 1067 312 833 572 303 901 1032 504 185 817 389 158 613 723 239 269 911 352 769 404 225 822 897 606 947 323 913 804 923 1084 552 901 486 249 209 898 847 610 728 1122 986 669 1116 1076 367 327"],["16133"]]]}} +{"instance_id":"pseudo_to_code_0.5k_74","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate ints n, x, y and z and array of integers sum with 3 elements\ndefine the main function\n read n\n decrement n and loop further, while n != 0\n read x, y and z\n add x to sum[0]\n add y to sum[1]\n add z to sum[2]\n end of the block\n if sum[0], sum[1] and sum[2] are all false\n print \"YES\\n\"\n else\n print \"NO\\n\"\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int n, x, y, z, sum[3];\nint main() {\n cin >> n;\n while (n--) {\n cin >> x >> y >> z;\n sum[0] += x;\n sum[1] += y;\n sum[2] += z;\n }\n if (!sum[0] && !sum[1] && !sum[2])\n cout << \"YES\\n\";\n else\n cout << \"NO\\n\";\n return 0;\n}","item":{"problem_id":"69A","pseudocode":"create ints n, x, y and z and array of integers sum with 3 elements\ndefine the main function\n read n\n decrement n and loop further, while n != 0\n read x, y and z\n add x to sum[0]\n add y to sum[1]\n add z to sum[2]\n end of the block\n if sum[0], sum[1] and sum[2] are all false\n print \"YES\\n\"\n else\n print \"NO\\n\"\n return to indicate successful execution\nend of the block","testcases":[[["3","4 1 7","-2 4 -1","1 -5 -3"],["NO"]],[["3","3 -1 7","-5 2 -4","2 -1 -3"],["YES"]],[["10","21 32 -46","43 -35 21","42 2 -50","22 40 20","-27 -9 38","-4 1 1","-40 6 -31","-13 -2 34","-21 34 -12","-32 -29 41"],["NO"]],[["10","25 -33 43","-27 -42 28","-35 -20 19","41 -42 -1","49 -39 -4","-49 -22 7","-19 29 41","8 -27 -43","8 34 9","-11 -3 33"],["NO"]],[["10","-6 21 18","20 -11 -8","37 -11 41","-5 8 33","29 23 32","30 -33 -11","39 -49 -36","28 34 -49","22 29 -34","-18 -6 7"],["NO"]],[["10","47 -2 -27","0 26 -14","5 -12 33","2 18 3","45 -30 -49","4 -18 8","-46 -44 -41","-22 -10 -40","-35 -21 26","33 20 38"],["NO"]],[["13","-3 -36 -46","-11 -50 37","42 -11 -15","9 42 44","-29 -12 24","3 9 -40","-35 13 50","14 43 18","-13 8 24","-48 -15 10","50 9 -50","21 0 -50","0 0 -6"],["YES"]],[["14","43 23 17","4 17 44","5 -5 -16","-43 -7 -6","47 -48 12","50 47 -45","2 14 43","37 -30 15","4 -17 -11","17 9 -45","-50 -3 -8","-50 0 0","-50 0 0","-16 0 0"],["YES"]],[["13","29 49 -11","38 -11 -20","25 1 -40","-11 28 11","23 -19 1","45 -41 -17","-3 0 -19","-13 -33 49","-30 0 28","34 17 45","-50 9 -27","-50 0 0","-37 0 0"],["YES"]],[["12","3 28 -35","-32 -44 -17","9 -25 -6","-42 -22 20","-19 15 38","-21 38 48","-1 -37 -28","-10 -13 -50","-5 21 29","34 28 50","50 11 -49","34 0 0"],["YES"]],[["37","-64 -79 26","-22 59 93","-5 39 -12","77 -9 76","55 -86 57","83 100 -97","-70 94 84","-14 46 -94","26 72 35","14 78 -62","17 82 92","-57 11 91","23 15 92","-80 -1 1","12 39 18","-23 -99 -75","-34 50 19","-39 84 -7","45 -30 -39","-60 49 37","45 -16 -72","33 -51 -56","-48 28 5","97 91 88","45 -82 -11","-21 -15 -90","-53 73 -26","-74 85 -90","-40 23 38","100 -13 49","32 -100 -100","0 -100 -70","0 -100 0","0 -100 0","0 -100 0","0 -100 0","0 -37 0"],["YES"]],[["4","68 3 100","68 21 -100","-100 -24 0","-36 0 0"],["YES"]],[["33","-1 -46 -12","45 -16 -21","-11 45 -21","-60 -42 -93","-22 -45 93","37 96 85","-76 26 83","-4 9 55","7 -52 -9","66 8 -85","-100 -54 11","-29 59 74","-24 12 2","-56 81 85","-92 69 -52","-26 -97 91","54 59 -51","58 21 -57","7 68 56","-47 -20 -51","-59 77 -13","-85 27 91","79 60 -56","66 -80 5","21 -99 42","-31 -29 98","66 93 76","-49 45 61","100 -100 -100","100 -100 -100","66 -75 -100","0 0 -100","0 0 -87"],["YES"]],[["3","1 2 3","3 2 1","0 0 0"],["NO"]],[["2","5 -23 12","0 0 0"],["NO"]],[["1","0 0 0"],["YES"]],[["1","1 -2 0"],["NO"]],[["2","-23 77 -86","23 -77 86"],["YES"]],[["26","86 7 20","-57 -64 39","-45 6 -93","-44 -21 100","-11 -49 21","73 -71 -80","-2 -89 56","-65 -2 7","5 14 84","57 41 13","-12 69 54","40 -25 27","-17 -59 0","64 -91 -30","-53 9 42","-54 -8 14","-35 82 27","-48 -59 -80","88 70 79","94 57 97","44 63 25","84 -90 -40","-100 100 -100","-92 100 -100","0 10 -100","0 0 -82"],["YES"]],[["42","11 27 92","-18 -56 -57","1 71 81","33 -92 30","82 83 49","-87 -61 -1","-49 45 49","73 26 15","-22 22 -77","29 -93 87","-68 44 -90","-4 -84 20","85 67 -6","-39 26 77","-28 -64 20","65 -97 24","-72 -39 51","35 -75 -91","39 -44 -8","-25 -27 -57","91 8 -46","-98 -94 56","94 -60 59","-9 -95 18","-53 -37 98","-8 -94 -84","-52 55 60","15 -14 37","65 -43 -25","94 12 66","-8 -19 -83","29 81 -78","-58 57 33","24 86 -84","-53 32 -88","-14 7 3","89 97 -53","-5 -28 -91","-100 100 -6","-84 100 0","0 100 0","0 70 0"],["YES"]],[["3","96 49 -12","2 -66 28","-98 17 -16"],["YES"]],[["5","70 -46 86","-100 94 24","-27 63 -63","57 -100 -47","0 -11 0"],["YES"]],[["18","-86 -28 70","-31 -89 42","31 -48 -55","95 -17 -43","24 -95 -85","-21 -14 31","68 -18 81","13 31 60","-15 28 99","-42 15 9","28 -61 -62","-16 71 29","-28 75 -48","-77 -67 36","-100 83 89","100 100 -100","57 34 -100","0 0 -53"],["YES"]],[["44","52 -54 -29","-82 -5 -94","-54 43 43","91 16 71","7 80 -91","3 15 29","-99 -6 -77","-3 -77 -64","73 67 34","25 -10 -18","-29 91 63","-72 86 -16","-68 85 -81","-3 36 44","-74 -14 -80","34 -96 -97","-76 -78 -33","-24 44 -58","98 12 77","95 -63 -6","-51 3 -90","-92 -10 72","7 3 -68","57 -53 71","29 57 -48","35 -60 10","79 -70 -61","-20 77 55","-86 -15 -35","84 -88 -18","100 -42 77","-20 46 8","-41 -43 -65","38 -98 -23","-100 65 45","-7 -91 -63","46 88 -85","48 59 100","0 0 100","0 0 100","0 0 100","0 0 100","0 0 100","0 0 1"],["YES"]],[["18","-14 -64 -91","-8 -66 -86","-23 92 -40","6 -3 -53","57 41 78","-79 42 -22","-88 -17 45","4 -45 44","83 -18 -25","34 86 -92","75 -30 12","44 99 11","-67 -13 72","22 83 -56","-37 71 72","-9 -100 100","0 -100 31","0 -58 0"],["YES"]],[["23","-70 37 78","42 84 6","28 -94 -24","-49 76 95","-67 18 84","-53 78 -5","65 -63 -64","-66 -64 -69","81 -93 95","10 52 -79","-89 -61 -64","-64 -47 43","-81 -35 55","80 82 73","-60 -81 -18","49 -10 -19","-58 70 12","-24 -15 -93","98 -93 -54","-28 -75 11","100 100 -63","100 100 0","56 34 0"],["YES"]],[["3","0 2 -2","1 -1 3","-3 0 0"],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_75","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare int variable n and int array x with size 105\n read n\n for i from 0 to n exclusive, read x[i]\n sort x\n Max and sum are integers with Max = x[n - 1] and sum = 0\n for i from 0 to n exclusive, add Max - x[i] to sum\n print sum\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, x[105];\n cin >> n;\n for (int i = 0; i < n; i++) { cin >> x[i]; }\n sort(x, x + n);\n int Max = x[n - 1], sum = 0;\n for (int i = 0; i < n; i++) { sum += Max - x[i]; }\n cout << sum << endl;\n return 0;\n}","item":{"problem_id":"758A","pseudocode":"define the main function\n declare int variable n and int array x with size 105\n read n\n for i from 0 to n exclusive, read x[i]\n sort x\n Max and sum are integers with Max = x[n - 1] and sum = 0\n for i from 0 to n exclusive, add Max - x[i] to sum\n print sum\n return to indicate successful execution\nend of the block","testcases":[[["5","0 1 2 3 4"],["10"]],[["5","1 1 0 1 1"],["1"]],[["3","1 3 1"],["4"]],[["1","12"],["0"]],[["3","1 2 3"],["3"]],[["14","52518 718438 358883 462189 853171 592966 225788 46977 814826 295697 676256 561479 56545 764281"],["5464380"]],[["21","842556 216391 427181 626688 775504 168309 851038 448402 880826 73697 593338 519033 135115 20128 424606 939484 846242 756907 377058 241543 29353"],["9535765"]],[["3","1 3 2"],["3"]],[["3","2 1 3"],["3"]],[["3","2 3 1"],["3"]],[["3","3 1 2"],["3"]],[["3","3 2 1"],["3"]],[["1","228503"],["0"]],[["2","32576 550340"],["517764"]],[["3","910648 542843 537125"],["741328"]],[["4","751720 572344 569387 893618"],["787403"]],[["6","433864 631347 597596 794426 713555 231193"],["1364575"]],[["9","31078 645168 695751 126111 375934 150495 838412 434477 993107"],["4647430"]],[["30","315421 772664 560686 654312 151528 356749 351486 707462 820089 226682 546700 136028 824236 842130 578079 337807 665903 764100 617900 822937 992759 591749 651310 742085 767695 695442 17967 515106 81059 186025"],["13488674"]],[["45","908719 394261 815134 419990 926993 383792 772842 277695 527137 655356 684956 695716 273062 550324 106247 399133 442382 33076 462920 294674 846052 817752 421365 474141 290471 358990 109812 74492 543281 169434 919692 786809 24028 197184 310029 801476 699355 429672 51343 374128 776726 850380 293868 981569 550763"],["21993384"]],[["56","100728 972537 13846 385421 756708 184642 259487 319707 376662 221694 675284 972837 499419 13846 38267 289898 901299 831197 954715 197515 514102 910423 127555 883934 362472 870788 538802 741008 973434 448124 391526 363321 947321 544618 68006 782313 955075 741981 815027 723297 585059 718114 700739 413489 454091 736144 308999 98065 3716 347323 9635 289003 986510 607065 60236 273351"],["26984185"]],[["70","644488 5444 150441 714420 602059 335330 510670 196555 546346 740011 509449 850947 692874 524857 750434 952985 223744 374727 896124 753037 367352 679050 560202 172728 569291 778616 332116 286927 843598 372698 244906 498046 900681 709791 420904 724593 864493 813094 791377 39998 296710 625656 403891 579231 706693 984045 16901 574259 562265 761104 930361 256045 124461 538980 573508 372148 988722 108592 784354 55302 232524 277205 782251 299943 436488 743389 324618 742543 266915 99642"],["32816391"]],[["1","0"],["0"]],[["1","1000000"],["0"]],[["100","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 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 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 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"],["0"]],[["100","1000000 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 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"],["99000000"]],[["100","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 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000000"],["99000000"]],[["100","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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000000 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 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 0"],["99000000"]],[["3","0 0 0"],["0"]],[["50","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"],["0"]],[["3","5 0 0"],["10"]],[["5","2 10 0 0 0"],["38"]]]}} +{"instance_id":"pseudo_to_code_0.5k_76","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n=int\n read n\n print 25\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n cout << \"25\" << endl;\n return 0;\n}","item":{"problem_id":"630A","pseudocode":"define the main function\n n=int\n read n\n print 25\n return to indicate successful execution\nend of the block","testcases":[[["2"],["25"]],[["7"],["25"]],[["1000000000000000000"],["25"]],[["2000000000000000000"],["25"]],[["987654321012345678"],["25"]],[["823457"],["25"]],[["247859"],["25"]],[["128349782"],["25"]],[["1891"],["25"]],[["95078394"],["25"]]]}} +{"instance_id":"pseudo_to_code_0.5k_77","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nMAXN = 105 = const int\nN, M = int\nlet arr be an int square matrix of size MAXN\nvotes = int array of length MAXN\nans = int\ndefine the main function\n read N, M\n for i = 1 to M inclusive\n max = -1 = int\n index = int\n for j = 1 to N inclusive\n read arr[i][j]\n if arr[i][j] > max\n set max to arr[i][j]\n set index to j\n end of the block\n end of the block\n increment votes at index\n end of the block\n max = -1 = int\n for i = 1 to N inclusive\n if votes at i > max\n set max to votes at i\n set ans to i\n end of the block\n end of the block\n print ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int MAXN = 105;\nint N, M;\nint arr[MAXN][MAXN];\nint votes[MAXN];\nint ans;\nint main() {\n cin >> N >> M;\n for (int i = 1; i <= M; i++) {\n int max = -1;\n int index;\n for (int j = 1; j <= N; j++) {\n cin >> arr[i][j];\n if (arr[i][j] > max) {\n max = arr[i][j];\n index = j;\n }\n }\n votes[index]++;\n }\n int max = -1;\n for (int i = 1; i <= N; i++) {\n if (votes[i] > max) {\n max = votes[i];\n ans = i;\n }\n }\n cout << ans << endl;\n return 0;\n}","item":{"problem_id":"570A","pseudocode":"MAXN = 105 = const int\nN, M = int\nlet arr be an int square matrix of size MAXN\nvotes = int array of length MAXN\nans = int\ndefine the main function\n read N, M\n for i = 1 to M inclusive\n max = -1 = int\n index = int\n for j = 1 to N inclusive\n read arr[i][j]\n if arr[i][j] > max\n set max to arr[i][j]\n set index to j\n end of the block\n end of the block\n increment votes at index\n end of the block\n max = -1 = int\n for i = 1 to N inclusive\n if votes at i > max\n set max to votes at i\n set ans to i\n end of the block\n end of the block\n print ans\n return to indicate successful execution\nend of the block","testcases":[[["3 3","1 2 3","2 3 1","1 2 1"],["2"]],[["3 4","10 10 3","5 1 6","2 2 2","1 5 7"],["1"]],[["1 3","5","3","2"],["1"]],[["3 1","1 2 3"],["3"]],[["3 1","100 100 100"],["1"]],[["2 2","1 2","2 1"],["1"]],[["2 2","2 1","2 1"],["1"]],[["2 2","1 2","1 2"],["2"]],[["3 3","0 0 0","1 1 1","2 2 2"],["1"]],[["1 1","1000000000"],["1"]],[["5 5","1 2 3 4 5","2 3 4 5 6","3 4 5 6 7","4 5 6 7 8","5 6 7 8 9"],["5"]],[["4 4","1 3 1 3","3 1 3 1","2 0 0 2","0 1 1 0"],["1"]],[["4 4","1 4 1 3","3 1 2 1","1 0 0 2","0 1 10 0"],["1"]],[["4 4","1 4 1 300","3 1 2 1","5 0 0 2","0 1 10 100"],["1"]],[["5 5","15 45 15 300 10","53 15 25 51 10","5 50 50 2 10","1000 1 10 100 10","10 10 10 10 10"],["1"]],[["1 100","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1"],["1"]],[["100 1","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"],["1"]],[["1 100","859","441","272","47","355","345","612","569","545","599","410","31","720","303","58","537","561","730","288","275","446","955","195","282","153","455","996","121","267","702","769","560","353","89","990","282","801","335","573","258","722","768","324","41","249","125","557","303","664","945","156","884","985","816","433","65","976","963","85","647","46","877","665","523","714","182","377","549","994","385","184","724","447","99","766","353","494","747","324","436","915","472","879","582","928","84","627","156","972","651","159","372","70","903","590","480","184","540","270","892"],["1"]],[["100 1","439 158 619 538 187 153 973 781 610 475 94 947 449 531 220 51 788 118 189 501 54 434 465 902 280 635 688 214 737 327 682 690 683 519 261 923 254 388 529 659 662 276 376 735 976 664 521 285 42 147 187 259 407 977 879 465 522 17 550 701 114 921 577 265 668 812 232 267 135 371 586 201 608 373 771 358 101 412 195 582 199 758 507 882 16 484 11 712 916 699 783 618 405 124 904 257 606 610 230 718"],["54"]],[["1 99","511","642","251","30","494","128","189","324","884","656","120","616","959","328","411","933","895","350","1","838","996","761","619","131","824","751","707","688","915","115","244","476","293","986","29","787","607","259","756","864","394","465","303","387","521","582","485","355","299","997","683","472","424","948","339","383","285","957","591","203","866","79","835","980","344","493","361","159","160","947","46","362","63","553","793","754","429","494","523","227","805","313","409","243","927","350","479","971","825","460","544","235","660","327","216","729","147","671","738"],["1"]],[["99 1","50 287 266 159 551 198 689 418 809 43 691 367 160 664 86 805 461 55 127 950 576 351 721 493 972 560 934 885 492 92 321 759 767 989 883 7 127 413 404 604 80 645 666 874 371 718 893 158 722 198 563 293 134 255 742 913 252 378 859 721 502 251 839 284 133 209 962 514 773 124 205 903 785 859 911 93 861 786 747 213 690 69 942 697 211 203 284 961 351 137 962 952 408 249 238 850 944 40 346"],["34"]],[["100 1","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2"],["100"]],[["1 1","0"],["1"]],[["2 1","0 0"],["1"]],[["2 2","0 0","0 0"],["1"]],[["2 2","1 2","0 0"],["1"]],[["3 3","0 0 0","0 0 0","0 0 0"],["1"]],[["2 3","0 0","0 0","0 1"],["1"]],[["3 2","1 1 3","0 0 0"],["1"]],[["3 4","1 10 3","0 0 0","0 0 0","0 0 0"],["1"]],[["2 4","2 1","1 2","0 0","1 2"],["1"]],[["2 2","0 1","0 1"],["2"]],[["2 3","1 2","0 0","2 1"],["1"]],[["2 2","0 0","4 5"],["1"]],[["3 2","10 15 20","0 0 0"],["1"]],[["3 4","0 0 0","0 0 0","0 0 0","1 2 3"],["1"]],[["3 3","0 0 0","0 0 0","0 0 1"],["1"]],[["3 3","0 0 0","1 2 3","1 3 2"],["1"]],[["3 1","0 0 0"],["1"]],[["3 3","0 0 1","0 0 0","0 0 0"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_78","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integers n, d\n read n read d\n create string s\n read s\n create integer array dp with size n\n for i = 0 to n exclusive, set dp[i] to 1e9\n set dp[0] to 0\n for i = 0 to size of s inclusive\n if s[i] is '1'\n for j = i - 1 to j is less than or equal to 0 and i - j is less than or equal to d, decrementing j\n if s[j] is 1, set dp[i] to minimum of dp[j] + 1 and dp[i]\n end of the block\n end of the block\n end of the block\n if dp[n-1] is 1e9\n print -1 print newline\n else\n print dp[n-1] print newline\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, d;\n cin >> n >> d;\n string s;\n cin >> s;\n int dp[n];\n for (int i = 0; i < n; ++i) { dp[i] = 1e9; }\n dp[0] = 0;\n for (int i = 0; i < s.size(); ++i) {\n if (s[i] == '1') {\n for (int j = i - 1; j >= 0 && i - j <= d; --j) {\n if (s[j] == '1') dp[i] = min(dp[j] + 1, dp[i]);\n }\n }\n }\n if (dp[n - 1] == 1e9)\n cout << -1 << endl;\n else\n cout << dp[n - 1] << endl;\n}","item":{"problem_id":"910A","pseudocode":"define the main function\n create integers n, d\n read n read d\n create string s\n read s\n create integer array dp with size n\n for i = 0 to n exclusive, set dp[i] to 1e9\n set dp[0] to 0\n for i = 0 to size of s inclusive\n if s[i] is '1'\n for j = i - 1 to j is less than or equal to 0 and i - j is less than or equal to d, decrementing j\n if s[j] is 1, set dp[i] to minimum of dp[j] + 1 and dp[i]\n end of the block\n end of the block\n end of the block\n if dp[n-1] is 1e9\n print -1 print newline\n else\n print dp[n-1] print newline\nend of the block","testcases":[[["8 4","10010101"],["2"]],[["4 2","1001"],["-1"]],[["8 4","11100101"],["3"]],[["12 3","101111100101"],["4"]],[["5 4","11011"],["1"]],[["5 4","10001"],["1"]],[["10 7","1101111011"],["2"]],[["10 9","1110000101"],["1"]],[["10 9","1100000001"],["1"]],[["20 5","11111111110111101001"],["4"]],[["20 11","11100000111000011011"],["2"]],[["20 19","10100000000000000001"],["1"]],[["50 13","10011010100010100111010000010000000000010100000101"],["5"]],[["50 8","11010100000011001100001100010001110000101100110011"],["8"]],[["99 4","111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111111111111"],["25"]],[["99 98","100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"],["1"]],[["100 5","1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"],["20"]],[["100 4","1111111111111111111111111111111111111111111111111111111111111111111111111111110111111111111111111111"],["25"]],[["100 4","1111111111111111111111111111111111111111111111111111111111111101111111011111111111111111111111111111"],["25"]],[["100 3","1111110111111111111111111111111111111111101111111111111111111111111101111111111111111111111111111111"],["34"]],[["100 8","1111111111101110111111111111111111111111111111111111111111111111111111110011111111111111011111111111"],["13"]],[["100 7","1011111111111111111011101111111011111101111111111101111011110111111111111111111111110111111011111111"],["15"]],[["100 9","1101111110111110101111111111111111011001110111011101011111111111010101111111100011011111111010111111"],["12"]],[["100 6","1011111011111111111011010110011001010101111110111111000111011011111110101101110110101111110000100111"],["18"]],[["100 7","1110001111101001110011111111111101111101101001010001101000101100000101101101011111111101101000100001"],["16"]],[["100 11","1000010100011100011011100000010011001111011110100100001011010100011011111001101101110110010110001101"],["10"]],[["100 9","1001001110000011100100000001000110111101101010101001000101001010011001101100110011011110110011011111"],["13"]],[["100 7","1010100001110101111011000111000001110100100110110001110110011010100001100100001110111100110000101001"],["18"]],[["100 10","1110110000000110000000101110100000111000001011100000100110010001110111001010101000011000000001011011"],["12"]],[["100 13","1000000100000000100011000010010000101010011110000000001000011000110100001000010001100000011001011001"],["9"]],[["100 11","1000000000100000010000100001000100000000010000100100000000100100001000000001011000110001000000000101"],["12"]],[["100 22","1000100000001010000000000000000001000000100000000000000000010000000000001000000000000000000100000001"],["7"]],[["100 48","1000000000000000011000000000000000000000000000000001100000000000000000000000000000000000000000000001"],["3"]],[["100 48","1000000000000000000000100000000000000000000000000000000000000000000001000000000000000000100000000001"],["3"]],[["100 75","1000000100000000000000000000000000000000000000000000000000000000000000000000000001000000000000000001"],["3"]],[["100 73","1000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000001"],["2"]],[["100 99","1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"],["1"]],[["100 1","1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"],["99"]],[["100 2","1111111111111111111111111111111110111111111111111111111111111111111111111111111111111111111111111111"],["50"]],[["100 1","1111111111111111011111111111111111111111111111111111111111111111111101111111111111111111111111111111"],["-1"]],[["100 3","1111111111111111111111111101111111111111111111111011111111111111111111111111111011111111111111111111"],["33"]],[["100 1","1101111111111111111111101111111111111111111111111111111111111011111111101111101111111111111111111111"],["-1"]],[["100 6","1111111111111111111111101111111101011110001111111111111111110111111111111111111111111110010111111111"],["17"]],[["100 2","1111111101111010110111011011110111101111111011111101010101011111011111111111111011111001101111101111"],["-1"]],[["100 8","1100110101111001101001111000111100110100011110111011001011111110000110101000001110111011100111011011"],["14"]],[["100 10","1000111110100000001001101100000010011100010101001100010011111001001101111110110111101111001010001101"],["11"]],[["100 7","1110000011010001110101011010000011110001000000011101110111010110001000011101111010010001101111110001"],["-1"]],[["100 3","1111010001000001011011000011001111000100101000101101000010111101111000010000011110110011001101010111"],["-1"]],[["100 9","1101010101101100010111011000010100001010000101010011001001100010110110000000010000101000000001101101"],["13"]],[["100 14","1010100000000000010101000010001100000000000011100010000001000001011010001110001010100000100001101101"],["9"]],[["100 13","1000000001101001110000010000011001000000000000001010000000100001001010000000000000000100010000000001"],["-1"]],[["100 18","1000000000000000110000000000000000010000000001000001000001000000000100000000000010000000000000000001"],["-1"]],[["100 32","1000000000000000000000000001000000000000000000000101000000000000000000000000000000000001000000000001"],["-1"]],[["100 79","1000000001000000000101000000000000000000000000000000000000000000000000000000000000000000000000000001"],["2"]],[["100 41","1000000000000000000000000000000000010000000000000000000000000000000000000000100000000000000000000001"],["3"]],[["100 82","1000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000001"],["2"]],[["100 96","1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"],["-1"]],[["43 30","1001000001111111010100100100110101011101101"],["2"]],[["7 1","1111111"],["6"]],[["9 3","101000001"],["-1"]],[["10 3","1100000001"],["-1"]],[["8 2","10000101"],["-1"]],[["2 1","11"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_79","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integer variables a and b\n read a and b and keep looping\n if a is greater than b, change a to b\n if a modulo 2 is 0\n print \"Malvika\"\n else\n print \"Akshat\"\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int a, b;\n while (cin >> a >> b) {\n if (a > b) a = b;\n if (a % 2 == 0)\n cout << \"Malvika\" << endl;\n else\n cout << \"Akshat\" << endl;\n }\n}","item":{"problem_id":"451A","pseudocode":"define the main function\n declare integer variables a and b\n read a and b and keep looping\n if a is greater than b, change a to b\n if a modulo 2 is 0\n print \"Malvika\"\n else\n print \"Akshat\"\n end of the block\nend of the block","testcases":[[["2 2"],["Malvika"]],[["2 3"],["Malvika"]],[["3 3"],["Akshat"]],[["20 68"],["Malvika"]],[["1 1"],["Akshat"]],[["1 2"],["Akshat"]],[["1 3"],["Akshat"]],[["2 1"],["Akshat"]],[["2 2"],["Malvika"]],[["3 1"],["Akshat"]],[["3 2"],["Malvika"]],[["68 42"],["Malvika"]],[["1 35"],["Akshat"]],[["25 70"],["Akshat"]],[["59 79"],["Akshat"]],[["65 63"],["Akshat"]],[["46 6"],["Malvika"]],[["28 82"],["Malvika"]],[["98 98"],["Malvika"]],[["98 99"],["Malvika"]],[["98 100"],["Malvika"]],[["99 98"],["Malvika"]],[["99 99"],["Akshat"]],[["99 100"],["Akshat"]],[["100 98"],["Malvika"]],[["100 99"],["Akshat"]],[["100 100"],["Malvika"]],[["3 4"],["Akshat"]]]}} +{"instance_id":"pseudo_to_code_0.5k_80","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integers a and b\n read a and b\n create integer sum = a + b\n create integer tempa = a\n declare integer variable tempb = b\n create integer i = 1\n create integer val = tempa\n create integer rem = 0\n declare integer rem1 = 0\n while val is greater than 0\n rem = val modulo 10\n divide val by 10\n if rem > 0\n increase rem1 by rem * i\n multiply i by 10\n end of the block\n end of the block\n declare integer newa = rem1\n set val to tempb\n set rem and rem1 to 0\n i = 1\n while val is greater than 0\n rem = val % 10\n divide val by 10\n if rem\n increase rem1 by rem * i\n multiply i by 10\n end of the block\n end of the block\n declare integer variable newb = rem1\n create integer newsum = newa + newb\n set val to sum\n rem and rem1 = 0\n set value of i to 1\n while val is greater than 0\n rem = val % 10\n divide val by 10\n if rem > 0\n increase rem1 by rem * i\n multiply i by 10\n end of the block\n end of the block\n if newsum = rem1\n print \"YES\"\n else\n print \"NO\"\n invoke function putchar with arguments '\\n'\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int a, b;\n cin >> a >> b;\n int sum = a + b;\n int tempa = a;\n int tempb = b;\n int i = 1;\n int val = tempa;\n int rem = 0;\n int rem1 = 0;\n while (val > 0) {\n rem = val % 10;\n val = val \/ 10;\n if (rem) {\n rem1 = rem1 + rem * i;\n i = i * 10;\n }\n }\n int newa = rem1;\n val = tempb;\n rem1 = rem = 0;\n i = 1;\n while (val > 0) {\n rem = val % 10;\n val = val \/ 10;\n if (rem) {\n rem1 = rem1 + rem * i;\n i = i * 10;\n }\n }\n int newb = rem1;\n int newsum = newa + newb;\n val = sum;\n rem1 = rem = 0;\n i = 1;\n while (val > 0) {\n rem = val % 10;\n val = val \/ 10;\n if (rem) {\n rem1 = rem1 + rem * i;\n i = i * 10;\n }\n }\n if (newsum == rem1)\n cout << \"YES\";\n else\n cout << \"NO\";\n putchar('\\n');\n return 0;\n}","item":{"problem_id":"75A","pseudocode":"define the main function\n declare integers a and b\n read a and b\n create integer sum = a + b\n create integer tempa = a\n declare integer variable tempb = b\n create integer i = 1\n create integer val = tempa\n create integer rem = 0\n declare integer rem1 = 0\n while val is greater than 0\n rem = val modulo 10\n divide val by 10\n if rem > 0\n increase rem1 by rem * i\n multiply i by 10\n end of the block\n end of the block\n declare integer newa = rem1\n set val to tempb\n set rem and rem1 to 0\n i = 1\n while val is greater than 0\n rem = val % 10\n divide val by 10\n if rem\n increase rem1 by rem * i\n multiply i by 10\n end of the block\n end of the block\n declare integer variable newb = rem1\n create integer newsum = newa + newb\n set val to sum\n rem and rem1 = 0\n set value of i to 1\n while val is greater than 0\n rem = val % 10\n divide val by 10\n if rem > 0\n increase rem1 by rem * i\n multiply i by 10\n end of the block\n end of the block\n if newsum = rem1\n print \"YES\"\n else\n print \"NO\"\n invoke function putchar with arguments '\\n'\n return to indicate successful execution\nend of the block","testcases":[[["101","102"],["YES"]],[["105","106"],["NO"]],[["544","397"],["YES"]],[["822","280"],["NO"]],[["101","413"],["NO"]],[["309","139"],["NO"]],[["693","970"],["NO"]],[["981","1"],["YES"]],[["352","276"],["YES"]],[["164","691"],["YES"]],[["110036","43"],["YES"]],[["100","1000"],["NO"]],[["1000000000","1000000000"],["YES"]],[["999999999","999999999"],["YES"]],[["6","4"],["NO"]],[["123456","876543"],["YES"]],[["1234567","9876543"],["NO"]],[["1111111","1119111"],["NO"]],[["10502405","40403403"],["YES"]],[["1","1"],["YES"]],[["5","4"],["YES"]],[["1","6"],["YES"]],[["40","17"],["NO"]],[["35","81"],["YES"]],[["347","908"],["NO"]],[["2081","7450"],["NO"]],[["84355694","373629503"],["NO"]],[["885992048","510468672"],["NO"]],[["540144752","647307841"],["NO"]],[["341781108","784147010"],["NO"]],[["960440938","572334653"],["NO"]],[["657414510","768771903"],["NO"]],[["501871728","725074574"],["NO"]],[["968","851"],["YES"]],[["943","939"],["YES"]],[["347","908"],["NO"]],[["611","41"],["YES"]],[["737","289"],["NO"]],[["168","571"],["YES"]],[["868","463"],["YES"]],[["815732007","913882008"],["NO"]],[["459039901","453033850"],["NO"]],[["975305404","484601256"],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_81","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integer n\n read n\n create integer ans with ans = 0\n increment ans by n \/ 100\n set n to n % 100\n increment ans by n \/ 20\n set n to n % 20\n increment ans by n \/ 10\n set n to n % 10\n increment ans by n \/ 5\n set n to n % 5\n increment ans by n \/ 1\n set n to n % 100\n print ans print newline\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n int ans = 0;\n ans += n \/ 100;\n n = n % 100;\n ans += n \/ 20;\n n = n % 20;\n ans += n \/ 10;\n n = n % 10;\n ans += n \/ 5;\n n = n % 5;\n ans += n \/ 1;\n n = n % 100;\n cout << ans << endl;\n}","item":{"problem_id":"996A","pseudocode":"define the main function\n create integer n\n read n\n create integer ans with ans = 0\n increment ans by n \/ 100\n set n to n % 100\n increment ans by n \/ 20\n set n to n % 20\n increment ans by n \/ 10\n set n to n % 10\n increment ans by n \/ 5\n set n to n % 5\n increment ans by n \/ 1\n set n to n % 100\n print ans print newline\nend of the block","testcases":[[["125"],["3"]],[["43"],["5"]],[["1000000000"],["10000000"]],[["4"],["4"]],[["5"],["1"]],[["1"],["1"]],[["74"],["8"]],[["31"],["3"]],[["59"],["8"]],[["79"],["9"]],[["7"],["3"]],[["55"],["4"]],[["40"],["2"]],[["719"],["13"]],[["847"],["13"]],[["225"],["4"]],[["4704"],["51"]],[["1132"],["15"]],[["7811"],["80"]],[["7981"],["84"]],[["82655"],["830"]],[["6364"],["70"]],[["74611"],["748"]],[["45391"],["459"]],[["620448"],["6210"]],[["265145"],["2654"]],[["671704"],["6721"]],[["365173"],["3658"]],[["7130872"],["71314"]],[["9628747"],["96292"]],[["8898399"],["88993"]],[["9497953"],["94985"]],[["19070947"],["190714"]],[["20185520"],["201856"]],[["91402248"],["914028"]],[["27035533"],["270360"]],[["22717528"],["227180"]],[["24403439"],["244041"]],[["163565555"],["1635659"]],[["152541908"],["1525423"]],[["668439837"],["6684403"]],[["20"],["1"]],[["999999999"],["10000009"]],[["10"],["1"]],[["7"],["3"]],[["6"],["2"]],[["99999999"],["1000009"]],[["1000001"],["10001"]],[["2521"],["27"]]]}} +{"instance_id":"pseudo_to_code_0.5k_82","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n Let N an int\n read N\n let ans an array of long longs of length 1000\n for i from 0 to N exclusive\n let a, b, and k long longs\n read a, b, and k\n if k is even\n set ans[i] to (a - b) * (k \/ 2)\n otherwise\n set ans[i] to (a - b) * (k \/ 2)\n add a to ans[i]\n end of the block\n end of the block\n print the first N values of ans\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int N;\n cin >> N;\n long long ans[1000];\n for (int i = 0; i < N; i++) {\n long long a, b, k;\n cin >> a >> b >> k;\n if (k % 2 == 0) {\n ans[i] = (a - b) * (k \/ 2);\n } else {\n ans[i] = (a - b) * (k \/ 2);\n ans[i] += a;\n }\n }\n for (int i = 0; i < N; i++) cout << ans[i] << endl;\n}","item":{"problem_id":"1077A","pseudocode":"define the main function\n Let N an int\n read N\n let ans an array of long longs of length 1000\n for i from 0 to N exclusive\n let a, b, and k long longs\n read a, b, and k\n if k is even\n set ans[i] to (a - b) * (k \/ 2)\n otherwise\n set ans[i] to (a - b) * (k \/ 2)\n add a to ans[i]\n end of the block\n end of the block\n print the first N values of ans\nend of the block","testcases":[[["6","5 2 3","100 1 4","1 10 5","1000000000 1 6","1 1 1000000000","1 1 999999999"],["8","198","-17","2999999997","0","1"]],[["1","19280817 1 1"],["19280817"]],[["1","598 56 799"],["216856"]],[["1","599 56 799"],["217256"]],[["16","602436426 877914575 158260522","623690081 861648772 24979445","262703497 476190629 433933447","628894325 971407775 211047202","450968417 822804784 731963982","161735902 982631932 430302156","707723857 923078537 880895728","802329211 910286918 189330739","317063340 303238506 404539679","125660016 773361868 492686568","462224593 839296263 650287940","191890310 384836991 492601449","404011431 782177068 576823355","160449218 954291757 818008580","164163676 840594328 155374934","501899080 138996221 797829355"],["-21798657830166889","-2972037274383821","-46319603170004939","-36143252634933450","-136085413920866697","-176616665780420340","-94852508808403520","-10219855367219672","2796347264445066","-159557001274561968","-122602579758329900","-47522907031806734","-109067385146931818","-324685004035492310","-52550183955038484","144767277282260623"]],[["70","1 1 1","1 1 2","1 1 3","1 1 4","1 1 5","1 1 6","1 1 7","1 1 8","1 1 9","1 1 10","1 2 1","1 2 2","1 2 3","1 2 4","1 2 5","1 2 6","1 2 7","1 2 8","1 2 9","1 2 10","1 3 1","1 3 2","1 3 3","1 3 4","1 3 5","1 3 6","1 3 7","1 3 8","1 3 9","1 3 10","1 4 1","1 4 2","1 4 3","1 4 4","1 4 5","1 4 6","1 4 7","1 4 8","1 4 9","1 4 10","1 5 1","1 5 2","1 5 3","1 5 4","1 5 5","1 5 6","1 5 7","1 5 8","1 5 9","1 5 10","1 6 1","1 6 2","1 6 3","1 6 4","1 6 5","1 6 6","1 6 7","1 6 8","1 6 9","1 6 10","1 7 1","1 7 2","1 7 3","1 7 4","1 7 5","1 7 6","1 7 7","1 7 8","1 7 9","1 7 10"],["1","0","1","0","1","0","1","0","1","0","1","-1","0","-2","-1","-3","-2","-4","-3","-5","1","-2","-1","-4","-3","-6","-5","-8","-7","-10","1","-3","-2","-6","-5","-9","-8","-12","-11","-15","1","-4","-3","-8","-7","-12","-11","-16","-15","-20","1","-5","-4","-10","-9","-15","-14","-20","-19","-25","1","-6","-5","-12","-11","-18","-17","-24","-23","-30"]],[["30","1 1 1000000000","1 1 999999999","1 1 999999998","1 1 999999997","1 1 999999996","1 1 999999995","1 1 999999994","1 1 999999993","1 1 999999992","1 1 999999991","1 2 1000000000","1 2 999999999","1 2 999999998","1 2 999999997","1 2 999999996","1 2 999999995","1 2 999999994","1 2 999999993","1 2 999999992","1 2 999999991","1 3 1000000000","1 3 999999999","1 3 999999998","1 3 999999997","1 3 999999996","1 3 999999995","1 3 999999994","1 3 999999993","1 3 999999992","1 3 999999991"],["0","1","0","1","0","1","0","1","0","1","-500000000","-499999998","-499999999","-499999997","-499999998","-499999996","-499999997","-499999995","-499999996","-499999994","-1000000000","-999999997","-999999998","-999999995","-999999996","-999999993","-999999994","-999999991","-999999992","-999999989"]],[["30","1 1000000000 1","1 1000000000 2","1 1000000000 3","1 1000000000 4","1 1000000000 5","1 1000000000 6","1 1000000000 7","1 1000000000 8","1 1000000000 9","1 1000000000 10","1 999999999 1","1 999999999 2","1 999999999 3","1 999999999 4","1 999999999 5","1 999999999 6","1 999999999 7","1 999999999 8","1 999999999 9","1 999999999 10","1 999999998 1","1 999999998 2","1 999999998 3","1 999999998 4","1 999999998 5","1 999999998 6","1 999999998 7","1 999999998 8","1 999999998 9","1 999999998 10"],["1","-999999999","-999999998","-1999999998","-1999999997","-2999999997","-2999999996","-3999999996","-3999999995","-4999999995","1","-999999998","-999999997","-1999999996","-1999999995","-2999999994","-2999999993","-3999999992","-3999999991","-4999999990","1","-999999997","-999999996","-1999999994","-1999999993","-2999999991","-2999999990","-3999999988","-3999999987","-4999999985"]],[["30","1000000000 1 1","1000000000 1 2","1000000000 1 3","1000000000 1 4","1000000000 1 5","1000000000 1 6","1000000000 1 7","1000000000 1 8","1000000000 1 9","1000000000 1 10","1000000000 2 1","1000000000 2 2","1000000000 2 3","1000000000 2 4","1000000000 2 5","1000000000 2 6","1000000000 2 7","1000000000 2 8","1000000000 2 9","1000000000 2 10","1000000000 3 1","1000000000 3 2","1000000000 3 3","1000000000 3 4","1000000000 3 5","1000000000 3 6","1000000000 3 7","1000000000 3 8","1000000000 3 9","1000000000 3 10"],["1000000000","999999999","1999999999","1999999998","2999999998","2999999997","3999999997","3999999996","4999999996","4999999995","1000000000","999999998","1999999998","1999999996","2999999996","2999999994","3999999994","3999999992","4999999992","4999999990","1000000000","999999997","1999999997","1999999994","2999999994","2999999991","3999999991","3999999988","4999999988","4999999985"]],[["20","1000000000 1 1000000000","1000000000 1 999999999","1000000000 1 999999998","1000000000 1 999999997","1000000000 1 999999996","1000000000 1 999999995","1000000000 1 999999994","1000000000 1 999999993","1000000000 1 999999992","1000000000 1 999999991","1000000000 2 1000000000","1000000000 2 999999999","1000000000 2 999999998","1000000000 2 999999997","1000000000 2 999999996","1000000000 2 999999995","1000000000 2 999999994","1000000000 2 999999993","1000000000 2 999999992","1000000000 2 999999991"],["499999999500000000","499999999500000001","499999998500000001","499999998500000002","499999997500000002","499999997500000003","499999996500000003","499999996500000004","499999995500000004","499999995500000005","499999999000000000","499999999000000002","499999998000000002","499999998000000004","499999997000000004","499999997000000006","499999996000000006","499999996000000008","499999995000000008","499999995000000010"]],[["20","1000000000 1000000000 1","1000000000 1000000000 2","1000000000 1000000000 3","1000000000 1000000000 4","1000000000 1000000000 5","1000000000 1000000000 6","1000000000 1000000000 7","1000000000 1000000000 8","1000000000 1000000000 9","1000000000 1000000000 10","1000000000 999999999 1","1000000000 999999999 2","1000000000 999999999 3","1000000000 999999999 4","1000000000 999999999 5","1000000000 999999999 6","1000000000 999999999 7","1000000000 999999999 8","1000000000 999999999 9","1000000000 999999999 10"],["1000000000","0","1000000000","0","1000000000","0","1000000000","0","1000000000","0","1000000000","1","1000000001","2","1000000002","3","1000000003","4","1000000004","5"]]]}} +{"instance_id":"pseudo_to_code_0.5k_83","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nvoid function READ with string arguments INPUT (default value \"NO\") and OUTPUT (default value \"NO\")\n if INPUT != \"NO\" open file INPUT.c_str() for reading\n if OUTPUT != \"NO\" open file OUTPUT.c_str() for writing\nend of the block\nlet A be integer array with size 200001\ndeclare string variables a and b\nfunction ok with integer argument k that returns boolean\n mp = map from integer to boolean\n for i = 0 to k exclusive, mp[A[i]] = 1\n create integer id = 0\n for i = 0 while id < length of b and i < length of a\n if mp[i] is not 0, continue the loop\n if a[i] = b[id], increment id\n end of the block\n return true if id >= length of b, else return false\nend of the block\ndefine the main function\n read a and b\n for i = 0 to length of a exclusive\n read A[i]\n decrement A[i]\n end of the block\n declare integers l, r, m and ans where l = 0 and r = length of a\n while l <= r\n m = (l + r) >> 1\n if ok(m)\n set ans to m\n set l to m + 1\n else\n assign value of m - 1 to r\n end of the block\n print ans and \"\\n\"\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"void READ(string INPUT = \"NO\", string OUTPUT = \"NO\") {\n if (INPUT != \"NO\") freopen(INPUT.c_str(), \"r\", stdin);\n if (OUTPUT != \"NO\") freopen(OUTPUT.c_str(), \"w\", stdout);\n}\nint A[200001];\nstring a, b;\nbool ok(int k) {\n map mp;\n for (int i = 0; i < k; i++) mp[A[i]] = 1;\n int id = 0;\n for (int i = 0; id < (int)b.size() && i < (int)a.size(); i++) {\n if (mp[i]) continue;\n if (a[i] == b[id]) id++;\n }\n return id >= (int)b.size();\n}\nint main() {\n cin >> a >> b;\n for (int i = 0; i < (int)a.size(); i++) {\n cin >> A[i];\n A[i]--;\n }\n int l = 0, r = (int)a.size(), m, ans;\n while (l <= r) {\n m = (l + r) >> 1;\n if (ok(m)) {\n ans = m;\n l = m + 1;\n } else\n r = m - 1;\n }\n cout << ans << \"\\n\";\n return 0;\n}","item":{"problem_id":"778A","pseudocode":"void function READ with string arguments INPUT (default value \"NO\") and OUTPUT (default value \"NO\")\n if INPUT != \"NO\" open file INPUT.c_str() for reading\n if OUTPUT != \"NO\" open file OUTPUT.c_str() for writing\nend of the block\nlet A be integer array with size 200001\ndeclare string variables a and b\nfunction ok with integer argument k that returns boolean\n mp = map from integer to boolean\n for i = 0 to k exclusive, mp[A[i]] = 1\n create integer id = 0\n for i = 0 while id < length of b and i < length of a\n if mp[i] is not 0, continue the loop\n if a[i] = b[id], increment id\n end of the block\n return true if id >= length of b, else return false\nend of the block\ndefine the main function\n read a and b\n for i = 0 to length of a exclusive\n read A[i]\n decrement A[i]\n end of the block\n declare integers l, r, m and ans where l = 0 and r = length of a\n while l <= r\n m = (l + r) >> 1\n if ok(m)\n set ans to m\n set l to m + 1\n else\n assign value of m - 1 to r\n end of the block\n print ans and \"\\n\"\n return to indicate successful execution\nend of the block","testcases":[[["ababcba","abb","5 3 4 1 7 6 2"],["3"]],[["bbbabb","bb","1 6 3 4 2 5"],["4"]],[["cacaccccccacccc","cacc","10 9 14 5 1 7 15 3 6 12 4 8 11 13 2"],["9"]],[["aaaabaaabaabaaaaaaaa","aaaa","18 5 4 6 13 9 1 3 7 8 16 10 12 19 17 15 14 11 20 2"],["16"]],[["aaaaaaaadbaaabbbbbddaaabdadbbbbbdbbabbbabaabdbbdababbbddddbdaabbddbbbbabbbbbabadaadabaaaadbbabbbaddb","aaaaaaaaaaaaaa","61 52 5 43 53 81 7 96 6 9 34 78 79 12 8 63 22 76 18 46 41 56 3 20 57 21 75 73 100 94 35 69 32 4 70 95 88 44 68 10 71 98 23 89 36 62 28 51 24 30 74 55 27 80 38 48 93 1 19 84 13 11 86 60 87 33 39 29 83 91 67 72 54 2 17 85 82 14 15 90 64 50 99 26 66 65 31 49 40 45 77 37 25 42 97 47 58 92 59 16"],["57"]],[["eaeaeaeaaaabeaaeadaaadbaabaedeadbdaedabaaaeaaadaabdeedaadaebaabbaadeadaedeadbeeeddabdeaddaadbaadabaaaebaeabadadadbeeadaddaaabdeebeaaaaaaddabdbaaeadddeadaaeaeaaeadaabbbabbbaaabdaddbaeabbbbbaabbbaeebeaa","adbaadbaea","199 61 186 122 163 50 181 144 198 187 145 60 10 128 117 3 143 99 59 83 9 20 51 48 63 38 2 34 41 103 80 90 87 8 1 85 88 12 26 159 91 127 77 24 28 154 116 29 158 125 27 97 151 46 175 25 58 171 178 142 86 96 84 43 35 64 124 70 180 104 135 33 101 47 105 162 195 185 92 5 155 95 6 45 123 112 194 118 189 98 174 114 165 72 93 110 37 36 56 138 126 7 179 148 23 57 42 111 100 137 120 30 78 160 184 134 176 200 197 67 39 69 53 73 81 113 18 150 183 55 76 65 131 196 193 139 82 182 79 146 15 115 169 52 21 40 167 32 153 156 173 147 149 22 74 19 161 190 108 172 130 16 94 136 177 107 54 109 4 141 66 11 188 13 68 89 129 71 192 164 49 166 170 106 168 14 102 62 44 75 132 191 119 133 152 157 17 31 121 140"],["158"]],[["eaeaeaeaaaabeaaeadaaadbaabaedeadbdaedabaaaeaaadaabdeedaadaebaabbaadeadaedeadbeeeddabdeaddaadbaadabaaaebaeabadadadbeeadaddaaabdeebeaaaaaaddabdbaaeadddeadaaeaeaaeadaabbbabbbaaabdaddbaeabbbbbaabbbaeebeaa","adbaadbaea","77 149 140 152 174 173 139 41 2 75 104 72 129 184 194 73 176 97 110 16 80 195 141 186 70 126 160 171 34 132 180 81 76 107 165 187 58 18 28 166 135 188 157 175 136 179 36 181 42 83 57 111 64 128 88 33 119 53 6 79 163 124 121 87 31 114 65 7 44 117 46 156 27 164 54 39 17 172 1 109 3 90 49 182 8 71 185 101 196 29 108 146 169 50 122 74 95 21 159 20 85 52 45 40 190 158 191 61 155 26 197 63 167 138 13 189 25 105 193 12 143 148 144 118 177 183 147 137 19 86 115 120 116 125 131 100 133 127 99 96 150 14 78 43 93 4 51 134 89 66 84 130 153 47 59 10 22 15 113 68 162 67 170 161 106 92 11 178 30 98 35 154 82 23 37 198 55 91 9 62 192 151 102 142 56 38 48 199 200 24 145 5 60 94 103 32 69 168 123 112"],["172"]],[["bbababaaabaaaabbbbbaaabcaaaabbaabbaabbababbbcaababcaadababaabaabbabababbbdbababbabbbbaabaaacaabaababbbbabbbaabbbbbdbbaaababbbabdbaaabbbabaabbabaabbabcabadbaaabbabbabdbabbcbabbbabaadaaaaaabaabbabbbbabbaabcabaababbabaababbbbababbbabaababaababbbaababaabaababbababbdbbabababbabbabaaaabaaaabaaaaaabaaabbaaabbababbabbaabaaaabbaabbabbbbaabbbaaaabbbbbbaaaabababbabaabbaaaaaaaabaabbabaaaabaabbaaababbbabaabbab","cccddcddcddcdcd","1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400"],["23"]],[["bbababaaabaaaabbbbbaaabcaaaabbaabbaabbababbbcaababcaadababaabaabbabababbbdbababbabbbbaabaaacaabaababbbbabbbaabbbbbdbbaaababbbabdbaaabbbabaabbabaabbabcabadbaaabbabbabdbabbcbabbbabaadaaaaaabaabbabbbbabbaabcabaababbabaababbbbababbbabaababaababbbaababaabaababbababbdbbabababbabbabaaaabaaaabaaaaaabaaabbaaabbababbabbaabaaaabbaabbabbbbaabbbaaaabbbbbbaaaabababbabaabbaaaaaaaabaabbabaaaabaabbaaababbbabaabbab","cccddcddcddcdcd","181 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_84","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate ints p, q, A, B, R, and i = 1 and int array C of size 2000000 containing {1, 1}\ndefine the main function\n read p and q\n for loop i to 2e6 exclusive\n if C[i] is falsy\n set A to A + q\n for j = i to 2e6 exclusive by incrementing by i, set C[j] to 1\n end of the block\n make ints r = 0 and t = i\n for loop while t is truthy and increment by r = 10 * r + t % 10 and t \/= 10\n end statement\n set B to B + p * (r == i )\n set R to A <= B ? i : R\n end of the block\n display R\nend of the block\n\n[CODE]:","reference_output":"int p, q, A, B, R, C[2000000] = {1, 1}, i = 1;\nint main() {\n cin >> p >> q;\n for (; i < 2e6; i++) {\n if (!C[i]) {\n A += q;\n for (int j = i; j < 2e6; j += i) C[j] = 1;\n }\n int r = 0, t = i;\n for (; t; r = 10 * r + t % 10, t \/= 10)\n ;\n B += p * (r == i);\n R = A <= B ? i : R;\n }\n cout << R << endl;\n}","item":{"problem_id":"568A","pseudocode":"create ints p, q, A, B, R, and i = 1 and int array C of size 2000000 containing {1, 1}\ndefine the main function\n read p and q\n for loop i to 2e6 exclusive\n if C[i] is falsy\n set A to A + q\n for j = i to 2e6 exclusive by incrementing by i, set C[j] to 1\n end of the block\n make ints r = 0 and t = i\n for loop while t is truthy and increment by r = 10 * r + t % 10 and t \/= 10\n end statement\n set B to B + p * (r == i )\n set R to A <= B ? i : R\n end of the block\n display R\nend of the block","testcases":[[["1 1"],["40"]],[["1 42"],["1"]],[["6 4"],["172"]],[["3 1"],["2530"]],[["42 1"],["1179858"]],[["10000 239"],["1168638"]],[["5 8"],["16"]],[["7 11"],["16"]],[["16 60"],["1"]],[["214 210"],["40"]],[["620 35"],["251262"]],[["940 480"],["1372"]],[["1307 3420"],["1"]],[["6811 5416"],["66"]],[["7 267"],["1"]],[["106 6"],["250300"]],[["10000 10000"],["40"]],[["10000 9999"],["40"]],[["9999 9998"],["40"]],[["9999 9999"],["40"]],[["4 9"],["10"]],[["1000 10000"],["1"]],[["238 9996"],["1"]],[["999 10000"],["1"]],[["241 10000"],["1"]],[["239 10000"],["1"]],[["5858 674"],["71118"]]]}} +{"instance_id":"pseudo_to_code_0.5k_85","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integers n, m, k, i, a, sum with sum = 0\n read n read m read k\n set a to m * 2\n for i = 1, incrementing i\n increment sum by a\n if k is less than sum\n print i print ' '\n break loop\n else if k is sum\n print i print m print ' ' print \"R\" print newline\n return to indicate successful execution\n end of the block\n end of the block\n decrement sum by a\n set a to k - sum\n if a % 2 is 1\n set a to a \/2\n print a + 1 print ' ' print \"L\" print newline\n else if a % 2 is 0\n set a to a \/ 2\n print a print ' ' print \"R\" print newline\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, m, k, i, a, sum = 0;\n cin >> n >> m >> k;\n a = m * 2;\n for (i = 1;; i++) {\n sum += a;\n if (k < sum) {\n cout << i << ' ';\n break;\n } else if (k == sum) {\n cout << i << ' ' << m << ' ' << \"R\" << endl;\n return 0;\n }\n }\n sum -= a;\n a = k - sum;\n if (a % 2 == 1) {\n a \/= 2;\n cout << a + 1 << ' ' << \"L\" << endl;\n } else if (a % 2 == 0) {\n a \/= 2;\n cout << a << ' ' << \"R\" << endl;\n }\n return 0;\n}","item":{"problem_id":"748A","pseudocode":"define the main function\n create integers n, m, k, i, a, sum with sum = 0\n read n read m read k\n set a to m * 2\n for i = 1, incrementing i\n increment sum by a\n if k is less than sum\n print i print ' '\n break loop\n else if k is sum\n print i print m print ' ' print \"R\" print newline\n return to indicate successful execution\n end of the block\n end of the block\n decrement sum by a\n set a to k - sum\n if a % 2 is 1\n set a to a \/2\n print a + 1 print ' ' print \"L\" print newline\n else if a % 2 is 0\n set a to a \/ 2\n print a print ' ' print \"R\" print newline\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["4 3 9"],["2 2 L"]],[["4 3 24"],["4 3 R"]],[["2 4 4"],["1 2 R"]],[["3 10 24"],["2 2 R"]],[["10 3 59"],["10 3 L"]],[["10000 10000 160845880"],["8043 2940 R"]],[["1 1 1"],["1 1 L"]],[["1 1 2"],["1 1 R"]],[["1 10000 1"],["1 1 L"]],[["1 10000 20000"],["1 10000 R"]],[["10000 1 1"],["1 1 L"]],[["10000 1 10000"],["5000 1 R"]],[["10000 1 20000"],["10000 1 R"]],[["3 2 1"],["1 1 L"]],[["3 2 2"],["1 1 R"]],[["3 2 3"],["1 2 L"]],[["3 2 4"],["1 2 R"]],[["3 2 5"],["2 1 L"]],[["3 2 6"],["2 1 R"]],[["3 2 7"],["2 2 L"]],[["3 2 8"],["2 2 R"]],[["3 2 9"],["3 1 L"]],[["3 2 10"],["3 1 R"]],[["3 2 11"],["3 2 L"]],[["3 2 12"],["3 2 R"]],[["300 2000 1068628"],["268 314 R"]],[["300 2000 584756"],["147 378 R"]],[["300 2000 268181"],["68 91 L"]],[["10000 9999 186450844"],["9324 4745 R"]],[["10000 9999 197114268"],["9857 6990 R"]],[["10000 9999 112390396"],["5621 818 R"]],[["10000 10000 1"],["1 1 L"]],[["10000 10000 2"],["1 1 R"]],[["10000 10000 100000001"],["5001 1 L"]],[["10000 10000 199999999"],["10000 10000 L"]],[["10000 10000 200000000"],["10000 10000 R"]],[["1 2 1"],["1 1 L"]],[["1 2 2"],["1 1 R"]],[["1 2 3"],["1 2 L"]],[["1 2 4"],["1 2 R"]],[["2 1 1"],["1 1 L"]],[["2 1 2"],["1 1 R"]],[["2 1 3"],["2 1 L"]],[["2 1 4"],["2 1 R"]],[["4 3 7"],["2 1 L"]],[["1 1 1"],["1 1 L"]]]}} +{"instance_id":"pseudo_to_code_0.5k_86","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let n be a integer\n read n\n print n\n for ( i= 1 to n-1 inclusive ), print space and i\n print newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n cout << n;\n for (int i = 1; i <= n - 1; i++) cout << \" \" << i;\n cout << endl;\n return 0;\n}","item":{"problem_id":"221A","pseudocode":"define the main function\n let n be a integer\n read n\n print n\n for ( i= 1 to n-1 inclusive ), print space and i\n print newline\n return to indicate successful execution\nend of the block","testcases":[[["1"],["1"]],[["2"],["2 1"]],[["3"],["3 1 2"]],[["4"],["4 1 2 3"]],[["5"],["5 1 2 3 4"]],[["6"],["6 1 2 3 4 5"]],[["7"],["7 1 2 3 4 5 6"]],[["101"],["101 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100"]],[["3"],["3 1 2"]],[["67"],["67 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66"]],[["99"],["99 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98"]],[["3"],["3 1 2"]],[["21"],["21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"]],[["22"],["22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21"]],[["23"],["23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22"]],[["24"],["24 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23"]],[["25"],["25 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24"]]]}} +{"instance_id":"pseudo_to_code_0.5k_87","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nin int function countSubseq taking a, b = string\n m = length of a = int\n n = length of b = int\n let dp be a matrix of sizes m+1, n+1, and set dp[0][0] = 0\n for i = 0 to n inclusive, increment i first, set dp[0][i] = 0\n for i = 0 to m inclusive, increment i first, set dp[i][0] = 1\n for i = 1 to m inclusive\n for j = 1 to n inclusive\n if a[i-1] = b[i-1]\n set dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j]\n else\n set dp[i][j] = dp[i - 1][j]\n end of the block\n end of the block\n return dp[m][n]\nend of the block\ndefine the main function\n n = string\n read n\n print countSubseq with args n, \"QAQ\"\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int countSubseq(string a, string b) {\n int m = a.length();\n int n = b.length();\n int dp[m + 1][n + 1] = {{0}};\n for (int i = 0; i <= n; ++i) dp[0][i] = 0;\n for (int i = 0; i <= m; ++i) dp[i][0] = 1;\n for (int i = 1; i <= m; i++) {\n for (int j = 1; j <= n; j++) {\n if (a[i - 1] == b[j - 1])\n dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j];\n else\n dp[i][j] = dp[i - 1][j];\n }\n }\n return dp[m][n];\n}\nint main() {\n string n;\n cin >> n;\n cout << countSubseq(n, \"QAQ\") << endl;\n return 0;\n}","item":{"problem_id":"894A","pseudocode":"in int function countSubseq taking a, b = string\n m = length of a = int\n n = length of b = int\n let dp be a matrix of sizes m+1, n+1, and set dp[0][0] = 0\n for i = 0 to n inclusive, increment i first, set dp[0][i] = 0\n for i = 0 to m inclusive, increment i first, set dp[i][0] = 1\n for i = 1 to m inclusive\n for j = 1 to n inclusive\n if a[i-1] = b[i-1]\n set dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j]\n else\n set dp[i][j] = dp[i - 1][j]\n end of the block\n end of the block\n return dp[m][n]\nend of the block\ndefine the main function\n n = string\n read n\n print countSubseq with args n, \"QAQ\"\n return to indicate successful execution\nend of the block","testcases":[[["QAQAQYSYIOIWIN"],["4"]],[["QAQQQZZYNOIWIN"],["3"]],[["QA"],["0"]],[["IAQVAQZLQBQVQFTQQQADAQJA"],["24"]],[["QQAAQASGAYAAAAKAKAQIQEAQAIAAIAQQQQQ"],["378"]],[["AMVFNFJIAVNQJWIVONQOAOOQSNQSONOASONAONQINAONAOIQONANOIQOANOQINAONOQINAONOXJCOIAQOAOQAQAQAQAQWWWAQQAQ"],["1077"]],[["AAQQAXBQQBQQXBNQRJAQKQNAQNQVDQASAGGANQQQQTJFFQQQTQQA"],["568"]],[["KAZXAVLPJQBQVQQQQQAPAQQGQTQVZQAAAOYA"],["70"]],[["W"],["0"]],[["DBA"],["0"]],[["RQAWNACASAAKAGAAAAQ"],["10"]],[["QJAWZAAOAAGIAAAAAOQATASQAEAAAAQFQQHPA"],["111"]],[["QQKWQAQAAAAAAAAGAAVAQUEQQUMQMAQQQNQLAMAAAUAEAAEMAAA"],["411"]],[["QQUMQAYAUAAGWAAAQSDAVAAQAAAASKQJJQQQQMAWAYYAAAAAAEAJAXWQQ"],["625"]],[["QORZOYAQ"],["1"]],[["QCQAQAGAWAQQQAQAVQAQQQQAQAQQQAQAAATQAAVAAAQQQQAAAUUQAQQNQQWQQWAQAAQQKQYAQAAQQQAAQRAQQQWBQQQQAPBAQGQA"],["13174"]],[["QQAQQAKQFAQLQAAWAMQAZQAJQAAQQOACQQAAAYANAQAQQAQAAQQAOBQQJQAQAQAQQQAAAAABQQQAVNZAQQQQAMQQAFAAEAQAQHQT"],["10420"]],[["AQEGQHQQKQAQQPQKAQQQAAAAQQQAQEQAAQAAQAQFSLAAQQAQOQQAVQAAAPQQAWAQAQAFQAXAQQQQTRLOQAQQJQNQXQQQQSQVDQQQ"],["12488"]],[["QNQKQQQLASQBAVQQQQAAQQOQRJQQAQQQEQZUOANAADAAQQJAQAQARAAAQQQEQBHTQAAQAAAAQQMKQQQIAOJJQQAQAAADADQUQQQA"],["9114"]],[["QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ"],["35937"]],[["AMQQAAQAAQAAAAAAQQQBOAAANAAKQJCYQAE"],["254"]],[["AYQBAEQGAQEOAKGIXLQJAIAKQAAAQPUAJAKAATFWQQAOQQQUFQYAQQMQHOKAAJXGFCARAQSATHAUQQAATQJJQDQRAANQQAE"],["2174"]],[["AAQXAAQAYQAAAAGAQHVQYAGIVACADFAAQAAAAQZAAQMAKZAADQAQDAAQDAAAMQQOXYAQQQAKQBAAQQKAXQBJZDDLAAHQQ"],["2962"]],[["AYQQYAVAMNIAUAAKBBQVACWKTQSAQZAAQAAASZJAWBCAALAARHACQAKQQAQAARPAQAAQAQAAZQUSHQAMFVFZQQQQSAQQXAA"],["2482"]],[["LQMAQQARQAQBJQQQAGAAZQQXALQQAARQAQQQQAAQQAQQQAQQCAQQAQQAYQQQRAAZATQALYQQAAHHAAQHAAAAAAAAQQMAAQNAKQ"],["7768"]],[["MAQQWAQOYQMAAAQAQPQZAOAAQAUAQNAAQAAAITQSAQAKAQKAQQWSQAAQQAGUCDQMQWKQUXKWQQAAQQAAQQZQDQQQAABXQUUXQOA"],["5422"]],[["QTAAQDAQXAQQJQQQGAAAQQQQSBQZKAQQAQQQQEAQNUQBZCQLYQZQEQQAAQHQVAORKQVAQYQNASZQAARZAAGAAAAOQDCQ"],["3024"]],[["QQWAQQGQQUZQQQLZAAQYQXQVAQFQUAQZUQZZQUKBHSHTQYLQAOQXAQQGAQQTQOAQARQADAJRAAQPQAQQUQAUAMAUVQAAAQQAWQ"],["4527"]],[["QQAAQQAQVAQZQQQQAOEAQZPQIBQZACQQAFQQLAAQDATZQANHKYQQAQTAAFQRQAIQAJPWQAQTEIRXAEQQAYWAAAUKQQAQAQQQSQQH"],["6416"]],[["AQQQQAQAAQQAQAQAAAAAAAAAQAQAAAAAQAQAQQQAQQQAAAQQQAAAAAAAQAAAAQQQQQQQAQQQQAQAAAQAAAAAQAQAAAAAQAQAAAA"],["14270"]],[["AQQQQAQAAQQAQAQAAAAAAAAAQAQAAAAAQAQAQQQAQQQAAAQQQAAAAAAAQAAAAQQQQQQQAQQQQAQAAAQAAAAAQAQAAAAAQ"],["13136"]],[["AQQQQAQAAQQAQAQAAAAAAAAAQAQAAAAAQAQAQQQAQQQAAAQQQAAAAAAAQAAAAQQQQQQQAQQQQAQAAAQAAAAAQAQAAAAAQAQAA"],["14270"]],[["AQQQQAQAAQQAQAQAAAAAAAAAQAQAAAAAQAQAQQQAQQQAAAQQQAAAAAAAQAAAAQQQQQQQAQQQQAQAAAQAAAAAQAQAAAAAQQAA"],["14231"]],[["QQQQQAQAAQQAQAQAAAAAAAAAQAQAAAAAQAQAQQQAQQQAAAQQQAAAAAAAQAAAAQQQQQQQAQQQQAQAAAQAAAAAQAQAAAAAQAQAA"],["15296"]],[["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ"],["0"]],[["QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"],["0"]],[["QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ"],["0"]],[["QAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQA"],["20825"]],[["AQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQ"],["20825"]],[["Q"],["0"]],[["A"],["0"]],[["FFF"],["0"]],[["AAAAAA"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_88","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n s = string\n read s\n l, u = int with l = 0 and u = 0\n for i = 0 to size of s\n if s[i] is a lower case letter\n increment l\n else\n increment u\n end of the block\n if l < u\n for i = 0 to size of s print toupper of s[i]\n print newline\n else\n for i = 0 to size of s print tolower of s[i]\n print newline\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string s;\n cin >> s;\n int l = 0, u = 0;\n for (int i = 0; i < s.size(); i++) {\n if (s[i] >= 'a' && s[i] <= 'z')\n l++;\n else\n u++;\n }\n if (l < u) {\n for (int i = 0; i < s.size(); i++) cout << char(toupper(s[i]));\n cout << endl;\n } else {\n for (int i = 0; i < s.size(); i++) cout << char(tolower(s[i]));\n cout << endl;\n }\n}","item":{"problem_id":"59A","pseudocode":"define the main function\n s = string\n read s\n l, u = int with l = 0 and u = 0\n for i = 0 to size of s\n if s[i] is a lower case letter\n increment l\n else\n increment u\n end of the block\n if l < u\n for i = 0 to size of s print toupper of s[i]\n print newline\n else\n for i = 0 to size of s print tolower of s[i]\n print newline\n end of the block\nend of the block","testcases":[[["HoUse"],["house"]],[["ViP"],["VIP"]],[["maTRIx"],["matrix"]],[["BNHWpnpawg"],["bnhwpnpawg"]],[["VTYGP"],["VTYGP"]],[["CHNenu"],["chnenu"]],[["ERPZGrodyu"],["erpzgrodyu"]],[["KSXBXWpebh"],["KSXBXWPEBH"]],[["qvxpqullmcbegsdskddortcvxyqlbvxmmkhevovnezubvpvnrcajpxraeaxizgaowtfkzywvhnbgzsxbhkaipcmoumtikkiyyaiv"],["qvxpqullmcbegsdskddortcvxyqlbvxmmkhevovnezubvpvnrcajpxraeaxizgaowtfkzywvhnbgzsxbhkaipcmoumtikkiyyaiv"]],[["Amnhaxtaopjzrkqlbroiyipitndczpunwygstmzevgyjdzyanxkdqnvgkikfabwouwkkbzuiuvgvxgpizsvqsbwepktpdrgdkmfd"],["amnhaxtaopjzrkqlbroiyipitndczpunwygstmzevgyjdzyanxkdqnvgkikfabwouwkkbzuiuvgvxgpizsvqsbwepktpdrgdkmfd"]],[["ISAGFJFARYFBLOPQDSHWGMCNKMFTLVFUGNJEWGWNBLXUIATXEkqiettmmjgydwcpafqrppdsrrrtguinqbgmzzfqwonkpgpcwenv"],["isagfjfaryfblopqdshwgmcnkmftlvfugnjewgwnblxuiatxekqiettmmjgydwcpafqrppdsrrrtguinqbgmzzfqwonkpgpcwenv"]],[["XHRPXZEGHSOCJPICUIXSKFUZUPYTSGJSDIYBCMNMNBPNDBXLXBzhbfnqvwcffvrdhtickyqhupmcehlsyvncqmfhautvxudqdhgg"],["xhrpxzeghsocjpicuixskfuzupytsgjsdiybcmnmnbpndbxlxbzhbfnqvwcffvrdhtickyqhupmcehlsyvncqmfhautvxudqdhgg"]],[["RJIQZMJCIMSNDBOHBRAWIENODSALETAKGKPYUFGVEFGCBRENZGAdkcetqjljtmttlonpekcovdzebzdkzggwfsxhapmjkdbuceak"],["RJIQZMJCIMSNDBOHBRAWIENODSALETAKGKPYUFGVEFGCBRENZGADKCETQJLJTMTTLONPEKCOVDZEBZDKZGGWFSXHAPMJKDBUCEAK"]],[["DWLWOBHNMMGTFOLFAECKBRNNGLYLYDXTGTVRLMEESZOIUATZZZXUFUZDLSJXMEVRTESSFBWLNZZCLCQWEVNNUCXYVHNGNXHCBDFw"],["DWLWOBHNMMGTFOLFAECKBRNNGLYLYDXTGTVRLMEESZOIUATZZZXUFUZDLSJXMEVRTESSFBWLNZZCLCQWEVNNUCXYVHNGNXHCBDFW"]],[["NYCNHJWGBOCOTSPETKKHVWFGAQYNHOVJWJHCIEFOUQZXOYUIEQDZALFKTEHTVDBVJMEUBJUBCMNVPWGDPNCHQHZJRCHYRFPVIGUB"],["NYCNHJWGBOCOTSPETKKHVWFGAQYNHOVJWJHCIEFOUQZXOYUIEQDZALFKTEHTVDBVJMEUBJUBCMNVPWGDPNCHQHZJRCHYRFPVIGUB"]],[["igxoixiecetohtgjgbqzvlaobkhstejxdklghowtvwunnnvauriohuspsdmpzckprwajyxldoyckgjivjpmbfqtszmtocovxwge"],["igxoixiecetohtgjgbqzvlaobkhstejxdklghowtvwunnnvauriohuspsdmpzckprwajyxldoyckgjivjpmbfqtszmtocovxwge"]],[["Ykkekrsqolzryiwsmdlnbmfautxxxauoojrddvwklgnlyrfcvhorrzbmtcrvpaypqhcffdqhwziipyyskcmztjprjqvmzzqhqnw"],["ykkekrsqolzryiwsmdlnbmfautxxxauoojrddvwklgnlyrfcvhorrzbmtcrvpaypqhcffdqhwziipyyskcmztjprjqvmzzqhqnw"]],[["YQOMLKYAORUQQUCQZCDYMIVDHGWZFFRMUVTAWCHERFPMNRYRIkgqrciokgajamehmcxgerpudvsqyonjonsxgbnefftzmygncks"],["yqomlkyaoruqqucqzcdymivdhgwzffrmuvtawcherfpmnryrikgqrciokgajamehmcxgerpudvsqyonjonsxgbnefftzmygncks"]],[["CDOZDPBVVVHNBJVBYHEOXWFLJKRWJCAJMIFCOZWWYFKVWOGTVJcuusigdqfkumewjtdyitveeiaybwrhomrwmpdipjwiuxfnwuz"],["CDOZDPBVVVHNBJVBYHEOXWFLJKRWJCAJMIFCOZWWYFKVWOGTVJCUUSIGDQFKUMEWJTDYITVEEIAYBWRHOMRWMPDIPJWIUXFNWUZ"]],[["WHIUVEXHVOOIJIDVJVPQUBJMEVPMPDKQWJKFBZSGSKUXMIPPMJWuckzcpxosodcjaaakvlxpbiigsiauviilylnnqlyucziihqg"],["WHIUVEXHVOOIJIDVJVPQUBJMEVPMPDKQWJKFBZSGSKUXMIPPMJWUCKZCPXOSODCJAAAKVLXPBIIGSIAUVIILYLNNQLYUCZIIHQG"]],[["VGHUNFOXKETUYMZDJNGTAOIOANYXSGYNFOGOFFLDAWEUKYFOZXCJTCAFXZYLQZERYZLRSQXYQGAPCSUDPMEYTNCTTTMFAGVDWBO"],["VGHUNFOXKETUYMZDJNGTAOIOANYXSGYNFOGOFFLDAWEUKYFOZXCJTCAFXZYLQZERYZLRSQXYQGAPCSUDPMEYTNCTTTMFAGVDWBO"]],[["EDUANHCQDOCJHFONTTSWBUJSTTIXBIXMAIUFSGFLXWAYIURTVAVZPYQDLAWIGCLMPHXCEFCJPFAAHXVNGQUFNHADAIUAZIDMHDd"],["EDUANHCQDOCJHFONTTSWBUJSTTIXBIXMAIUFSGFLXWAYIURTVAVZPYQDLAWIGCLMPHXCEFCJPFAAHXVNGQUFNHADAIUAZIDMHDD"]],[["EBWOVSNLYTWWXrnovgugogtjahnmatomubebyxakas"],["ebwovsnlytwwxrnovgugogtjahnmatomubebyxakas"]],[["AORNNDKTRLRVGDPXJKXFTPFpopuzrlqumrxssskvbm"],["AORNNDKTRLRVGDPXJKXFTPFPOPUZRLQUMRXSSSKVBM"]],[["DBBZJCWQEVGYHEEUHJAWRHBDPsnplijbwtdibqrrheebfxqcvn"],["dbbzjcwqevgyheeuhjawrhbdpsnplijbwtdibqrrheebfxqcvn"]],[["t"],["t"]],[["N"],["N"]],[["kv"],["kv"]],[["Ur"],["ur"]],[["CN"],["CN"]]]}} +{"instance_id":"pseudo_to_code_0.5k_89","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integers n1, n2, k1, k2\n read n1 read n2 read k1 read k2\n print \"First\" if n1 is greater than n2, else \"Second\", print '\\n'\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n1, n2, k1, k2;\n cin >> n1 >> n2 >> k1 >> k2;\n cout << (n1 > n2 ? \"First\" : \"Second\") << '\\n';\n return 0;\n}","item":{"problem_id":"513A","pseudocode":"define the main function\n create integers n1, n2, k1, k2\n read n1 read n2 read k1 read k2\n print \"First\" if n1 is greater than n2, else \"Second\", print '\\n'\n return to indicate successful execution\nend of the block","testcases":[[["2 2 1 2"],["Second"]],[["2 1 1 1"],["First"]],[["5 7 4 1"],["Second"]],[["5 7 1 4"],["Second"]],[["5 7 10 10"],["Second"]],[["5 7 1 10"],["Second"]],[["1 1 1 1"],["Second"]],[["50 50 50 50"],["Second"]],[["50 49 1 2"],["First"]],[["50 48 3 1"],["First"]],[["48 50 12 11"],["Second"]],[["49 50 11 12"],["Second"]],[["49 49 4 1"],["Second"]],[["49 49 3 3"],["Second"]],[["1 50 1 50"],["Second"]],[["1 50 50 50"],["Second"]],[["50 1 1 1"],["First"]],[["50 1 1 50"],["First"]],[["32 31 10 9"],["First"]],[["32 4 17 3"],["First"]]]}} +{"instance_id":"pseudo_to_code_0.5k_90","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nlet a be an int array of length 1010\ndefine the main function\n let N, K be ints\n read N, K\n for i = 1 to N*2+1 inclusive the read a[i]\n let int k = 0\n for i = 2 to N*2 inclusive\n if a[i] > a[i - 1] + 1 and a[i] > a[i + 1] + 1\n decrement a at i\n increment k\n if k is same as K, exit loop\n end of the block\n end of the block\n for i = 1 to N * 2, print a at i and space\n print a[N * 2 + 1]\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int a[1010];\nint main() {\n int N, K;\n cin >> N >> K;\n for (int i = 1; i <= N * 2 + 1; i++) { cin >> a[i]; }\n int k = 0;\n for (int i = 2; i <= N * 2; i++) {\n if (a[i] > a[i - 1] + 1 && a[i] > a[i + 1] + 1) {\n a[i]--;\n k++;\n if (k == K) break;\n }\n }\n for (int i = 1; i <= N * 2; i++) { cout << a[i] << \" \"; }\n cout << a[N * 2 + 1] << endl;\n return 0;\n}","item":{"problem_id":"218A","pseudocode":"let a be an int array of length 1010\ndefine the main function\n let N, K be ints\n read N, K\n for i = 1 to N*2+1 inclusive the read a[i]\n let int k = 0\n for i = 2 to N*2 inclusive\n if a[i] > a[i - 1] + 1 and a[i] > a[i + 1] + 1\n decrement a at i\n increment k\n if k is same as K, exit loop\n end of the block\n end of the block\n for i = 1 to N * 2, print a at i and space\n print a[N * 2 + 1]\n return to indicate successful execution\nend of the block","testcases":[[["3 2","0 5 3 5 1 5 2"],["0 4 3 4 1 5 2"]],[["1 1","0 2 0"],["0 1 0"]],[["1 1","1 100 0"],["1 99 0"]],[["3 1","0 1 0 1 0 2 0"],["0 1 0 1 0 1 0"]],[["3 1","0 1 0 2 0 1 0"],["0 1 0 1 0 1 0"]],[["3 3","0 100 35 67 40 60 3"],["0 99 35 66 40 59 3"]],[["7 3","1 2 1 3 1 2 1 2 1 3 1 3 1 2 1"],["1 2 1 2 1 2 1 2 1 2 1 2 1 2 1"]],[["100 100","1 3 1 3 1 3 0 2 0 3 1 3 1 3 1 3 0 3 1 3 0 2 0 2 0 3 0 2 0 2 0 3 1 3 1 3 1 3 1 3 0 2 0 3 1 3 0 2 0 2 0 2 0 2 0 2 0 3 0 3 0 3 0 3 0 2 0 3 1 3 1 3 1 3 0 3 0 2 0 2 0 2 0 2 0 3 0 3 1 3 0 3 1 3 1 3 0 3 1 3 0 3 1 3 1 3 0 3 1 3 0 3 1 3 0 2 0 3 1 3 0 3 1 3 0 2 0 3 1 3 0 3 0 2 0 3 1 3 0 3 0 3 0 2 0 2 0 2 0 3 0 3 1 3 1 3 0 3 1 3 1 3 1 3 0 2 0 3 0 2 0 3 1 3 0 3 0 3 1 3 0 2 0 3 0 2 0 2 0 2 0 2 0 3 1 3 0 3 1 3 1"],["1 2 1 2 1 2 0 1 0 2 1 2 1 2 1 2 0 2 1 2 0 1 0 1 0 2 0 1 0 1 0 2 1 2 1 2 1 2 1 2 0 1 0 2 1 2 0 1 0 1 0 1 0 1 0 1 0 2 0 2 0 2 0 2 0 1 0 2 1 2 1 2 1 2 0 2 0 1 0 1 0 1 0 1 0 2 0 2 1 2 0 2 1 2 1 2 0 2 1 2 0 2 1 2 1 2 0 2 1 2 0 2 1 2 0 1 0 2 1 2 0 2 1 2 0 1 0 2 1 2 0 2 0 1 0 2 1 2 0 2 0 2 0 1 0 1 0 1 0 2 0 2 1 2 1 2 0 2 1 2 1 2 1 2 0 1 0 2 0 1 0 2 1 2 0 2 0 2 1 2 0 1 0 2 0 1 0 1 0 1 0 1 0 2 1 2 0 2 1 2 1"]],[["30 20","1 3 1 3 0 2 0 4 1 3 0 3 1 3 1 4 2 3 1 2 0 4 2 4 0 4 1 3 0 4 1 4 2 4 2 4 0 3 1 2 1 4 0 3 0 4 1 3 1 4 1 3 0 1 0 4 0 3 2 3 1"],["1 2 1 2 0 1 0 3 1 2 0 2 1 2 1 3 2 3 1 2 0 3 2 3 0 3 1 2 0 3 1 3 2 3 2 3 0 2 1 2 1 3 0 2 0 3 1 3 1 4 1 3 0 1 0 4 0 3 2 3 1"]],[["10 6","0 5 2 4 1 5 2 5 2 4 2 5 3 5 0 2 0 1 0 1 0"],["0 4 2 3 1 4 2 4 2 3 2 4 3 5 0 2 0 1 0 1 0"]],[["11 6","3 5 1 4 3 5 0 2 0 2 0 4 0 3 0 4 1 5 2 4 0 4 0"],["3 4 1 4 3 4 0 1 0 1 0 3 0 2 0 4 1 5 2 4 0 4 0"]],[["12 6","1 2 1 5 0 2 0 4 1 3 1 4 2 4 0 4 0 4 2 4 0 4 0 5 3"],["1 2 1 4 0 1 0 3 1 2 1 3 2 3 0 4 0 4 2 4 0 4 0 5 3"]],[["13 6","3 5 2 5 0 3 0 1 0 2 0 1 0 1 0 2 1 4 3 5 1 3 1 3 2 3 1"],["3 4 2 4 0 2 0 1 0 1 0 1 0 1 0 2 1 4 3 4 1 2 1 3 2 3 1"]],[["24 7","3 4 2 4 1 4 3 4 3 5 1 3 1 3 0 3 0 3 1 4 0 3 0 1 0 1 0 3 2 3 2 3 1 2 1 3 2 5 1 3 0 1 0 2 0 3 1 3 1"],["3 4 2 3 1 4 3 4 3 4 1 2 1 2 0 2 0 2 1 3 0 3 0 1 0 1 0 3 2 3 2 3 1 2 1 3 2 5 1 3 0 1 0 2 0 3 1 3 1"]],[["25 8","3 5 2 4 2 4 0 1 0 1 0 1 0 2 1 5 2 4 2 4 2 3 1 2 0 1 0 2 0 3 2 5 3 5 0 4 2 3 2 4 1 4 0 4 1 4 0 1 0 4 2"],["3 4 2 3 2 3 0 1 0 1 0 1 0 2 1 4 2 3 2 3 2 3 1 2 0 1 0 1 0 3 2 4 3 5 0 4 2 3 2 4 1 4 0 4 1 4 0 1 0 4 2"]],[["26 9","3 4 2 3 1 3 1 3 2 4 0 1 0 2 1 3 1 3 0 5 1 4 3 5 0 5 2 3 0 3 1 4 1 3 1 4 2 3 1 4 3 4 1 3 2 4 1 3 2 5 1 2 0"],["3 4 2 3 1 2 1 3 2 3 0 1 0 2 1 2 1 2 0 4 1 4 3 4 0 4 2 3 0 2 1 3 1 3 1 4 2 3 1 4 3 4 1 3 2 4 1 3 2 5 1 2 0"]],[["27 10","3 5 3 5 3 4 1 3 1 3 1 3 2 3 2 3 2 4 2 3 0 4 2 5 3 4 3 4 1 5 3 4 1 2 1 5 0 3 0 5 0 5 3 4 0 1 0 2 0 2 1 4 0 2 1"],["3 4 3 4 3 4 1 2 1 2 1 3 2 3 2 3 2 3 2 3 0 3 2 4 3 4 3 4 1 4 3 4 1 2 1 4 0 2 0 5 0 5 3 4 0 1 0 2 0 2 1 4 0 2 1"]],[["40 1","0 2 1 2 0 2 1 2 1 2 1 2 1 2 1 3 0 1 0 1 0 1 0 2 0 2 1 2 0 2 1 2 1 2 1 2 1 2 0 2 1 2 1 2 0 1 0 2 0 2 0 1 0 1 0 1 0 1 0 1 0 2 0 2 0 2 0 1 0 2 0 1 0 2 0 1 0 2 1 2 0"],["0 2 1 2 0 2 1 2 1 2 1 2 1 2 1 2 0 1 0 1 0 1 0 2 0 2 1 2 0 2 1 2 1 2 1 2 1 2 0 2 1 2 1 2 0 1 0 2 0 2 0 1 0 1 0 1 0 1 0 1 0 2 0 2 0 2 0 1 0 2 0 1 0 2 0 1 0 2 1 2 0"]],[["40 2","0 3 1 2 1 2 0 1 0 2 1 3 0 2 0 3 0 3 0 1 0 2 0 3 1 2 0 2 1 2 0 2 0 1 0 1 0 2 0 2 1 3 0 2 0 1 0 1 0 1 0 3 1 3 1 2 1 2 0 3 0 1 0 3 0 2 1 2 0 1 0 2 0 3 1 2 1 3 1 3 0"],["0 2 1 2 1 2 0 1 0 2 1 2 0 2 0 3 0 3 0 1 0 2 0 3 1 2 0 2 1 2 0 2 0 1 0 1 0 2 0 2 1 3 0 2 0 1 0 1 0 1 0 3 1 3 1 2 1 2 0 3 0 1 0 3 0 2 1 2 0 1 0 2 0 3 1 2 1 3 1 3 0"]],[["40 3","1 3 1 2 0 4 1 2 0 1 0 1 0 3 0 3 2 3 0 3 1 3 0 4 1 3 2 3 0 2 1 3 0 2 0 1 0 3 1 3 2 3 2 3 0 1 0 2 0 1 0 1 0 3 1 3 0 3 1 3 1 2 0 1 0 3 0 2 0 3 0 1 0 2 0 3 1 2 0 3 0"],["1 2 1 2 0 3 1 2 0 1 0 1 0 2 0 3 2 3 0 3 1 3 0 4 1 3 2 3 0 2 1 3 0 2 0 1 0 3 1 3 2 3 2 3 0 1 0 2 0 1 0 1 0 3 1 3 0 3 1 3 1 2 0 1 0 3 0 2 0 3 0 1 0 2 0 3 1 2 0 3 0"]],[["50 40","1 4 2 4 1 2 1 4 1 4 2 3 1 2 1 4 1 3 0 2 1 4 0 1 0 3 1 3 1 3 0 4 2 4 2 4 2 4 2 4 2 4 2 4 0 4 1 3 1 3 0 4 1 4 2 3 2 3 0 3 0 3 0 4 1 4 1 3 1 4 1 3 0 4 0 3 0 2 0 2 0 4 1 4 0 2 0 4 1 4 0 3 0 2 1 3 0 2 0 4 0"],["1 3 2 3 1 2 1 3 1 3 2 3 1 2 1 3 1 2 0 2 1 3 0 1 0 2 1 2 1 2 0 3 2 3 2 3 2 3 2 3 2 3 2 3 0 3 1 2 1 2 0 3 1 3 2 3 2 3 0 2 0 2 0 3 1 3 1 2 1 3 1 2 0 3 0 2 0 1 0 1 0 3 1 3 0 1 0 3 1 3 0 2 0 2 1 2 0 2 0 4 0"]],[["100 2","1 3 1 2 1 3 2 3 1 3 1 3 1 3 1 2 0 3 0 2 0 3 2 3 0 3 1 2 1 2 0 3 0 1 0 1 0 3 2 3 1 2 0 1 0 2 0 1 0 2 1 3 1 2 1 3 2 3 1 3 1 2 0 3 2 3 0 2 1 3 1 2 0 3 2 3 1 3 2 3 0 4 0 3 0 1 0 3 0 1 0 1 0 2 0 2 1 3 1 2 1 2 0 2 0 1 0 2 0 2 1 3 1 3 2 3 0 2 1 2 0 3 0 1 0 2 0 3 2 3 1 3 0 3 1 2 0 1 0 3 0 1 0 1 0 1 0 2 0 1 0 2 1 2 1 2 1 3 0 1 0 2 1 3 0 2 1 3 0 2 1 2 0 3 1 3 1 3 0 2 1 2 1 3 0 2 1 3 2 3 1 2 0 3 1 2 0 3 1 2 0"],["1 2 1 2 1 3 2 3 1 2 1 3 1 3 1 2 0 3 0 2 0 3 2 3 0 3 1 2 1 2 0 3 0 1 0 1 0 3 2 3 1 2 0 1 0 2 0 1 0 2 1 3 1 2 1 3 2 3 1 3 1 2 0 3 2 3 0 2 1 3 1 2 0 3 2 3 1 3 2 3 0 4 0 3 0 1 0 3 0 1 0 1 0 2 0 2 1 3 1 2 1 2 0 2 0 1 0 2 0 2 1 3 1 3 2 3 0 2 1 2 0 3 0 1 0 2 0 3 2 3 1 3 0 3 1 2 0 1 0 3 0 1 0 1 0 1 0 2 0 1 0 2 1 2 1 2 1 3 0 1 0 2 1 3 0 2 1 3 0 2 1 2 0 3 1 3 1 3 0 2 1 2 1 3 0 2 1 3 2 3 1 2 0 3 1 2 0 3 1 2 0"]],[["100 3","0 2 1 2 0 1 0 1 0 3 0 2 1 3 1 3 2 3 0 2 0 1 0 2 0 1 0 3 2 3 2 3 1 2 1 3 1 2 1 3 2 3 2 3 0 3 2 3 2 3 2 3 0 2 0 3 0 3 2 3 2 3 2 3 2 3 0 3 0 1 0 2 1 3 0 2 1 2 0 3 2 3 2 3 1 3 0 3 1 3 0 3 0 1 0 1 0 2 0 2 1 2 0 3 1 3 0 3 2 3 2 3 2 3 2 3 0 1 0 1 0 1 0 2 1 2 0 2 1 3 2 3 0 1 0 1 0 1 0 1 0 2 0 1 0 3 1 2 1 2 1 3 1 2 0 3 0 2 1 2 1 3 2 3 1 3 2 3 0 1 0 1 0 1 0 1 0 3 0 1 0 2 1 2 0 3 1 3 2 3 0 3 1 2 1 3 1 3 1 3 0"],["0 2 1 2 0 1 0 1 0 2 0 2 1 2 1 3 2 3 0 1 0 1 0 2 0 1 0 3 2 3 2 3 1 2 1 3 1 2 1 3 2 3 2 3 0 3 2 3 2 3 2 3 0 2 0 3 0 3 2 3 2 3 2 3 2 3 0 3 0 1 0 2 1 3 0 2 1 2 0 3 2 3 2 3 1 3 0 3 1 3 0 3 0 1 0 1 0 2 0 2 1 2 0 3 1 3 0 3 2 3 2 3 2 3 2 3 0 1 0 1 0 1 0 2 1 2 0 2 1 3 2 3 0 1 0 1 0 1 0 1 0 2 0 1 0 3 1 2 1 2 1 3 1 2 0 3 0 2 1 2 1 3 2 3 1 3 2 3 0 1 0 1 0 1 0 1 0 3 0 1 0 2 1 2 0 3 1 3 2 3 0 3 1 2 1 3 1 3 1 3 0"]],[["100 20","0 1 0 3 0 3 2 3 2 4 0 2 0 3 1 3 0 2 0 2 0 3 0 1 0 3 2 4 0 1 0 2 0 2 1 2 1 4 2 4 1 2 0 1 0 2 1 3 0 2 1 3 2 3 1 2 0 2 1 4 0 3 0 2 0 1 0 1 0 1 0 2 1 3 2 3 2 3 2 3 0 1 0 1 0 4 2 3 2 3 0 3 1 2 0 2 0 2 1 3 2 3 1 4 0 1 0 2 1 2 0 2 0 3 2 3 0 2 0 2 1 4 2 3 1 3 0 3 0 2 0 2 1 2 1 3 0 3 1 2 1 3 1 3 1 2 1 2 0 2 1 3 0 2 0 3 0 1 0 3 0 3 0 1 0 4 1 3 0 1 0 1 0 2 1 2 0 2 1 4 1 3 0 2 1 3 1 3 1 3 0 3 0 2 0 1 0 2 1 2 1"],["0 1 0 2 0 3 2 3 2 3 0 1 0 2 1 2 0 1 0 1 0 2 0 1 0 3 2 3 0 1 0 1 0 2 1 2 1 3 2 3 1 2 0 1 0 2 1 2 0 2 1 3 2 3 1 2 0 2 1 3 0 2 0 1 0 1 0 1 0 1 0 2 1 3 2 3 2 3 2 3 0 1 0 1 0 3 2 3 2 3 0 2 1 2 0 1 0 2 1 3 2 3 1 3 0 1 0 2 1 2 0 2 0 3 2 3 0 2 0 2 1 4 2 3 1 3 0 3 0 2 0 2 1 2 1 3 0 3 1 2 1 3 1 3 1 2 1 2 0 2 1 3 0 2 0 3 0 1 0 3 0 3 0 1 0 4 1 3 0 1 0 1 0 2 1 2 0 2 1 4 1 3 0 2 1 3 1 3 1 3 0 3 0 2 0 1 0 2 1 2 1"]],[["100 20","2 3 0 4 0 1 0 6 3 4 3 6 4 6 0 9 0 6 2 7 3 8 7 10 2 9 3 9 5 6 5 10 3 7 1 5 2 8 3 7 2 3 1 6 0 8 3 8 0 4 1 8 3 7 1 9 5 9 5 8 7 8 5 6 5 8 1 9 8 9 8 10 7 10 5 8 6 10 2 6 3 9 2 6 3 10 5 9 3 10 1 3 2 11 8 9 8 10 1 8 7 11 0 9 5 8 4 5 0 7 3 7 5 9 5 10 1 7 1 9 1 6 3 8 2 4 1 4 2 6 0 4 2 4 2 7 6 9 0 1 0 4 0 4 0 9 2 7 6 7 2 8 0 8 2 7 5 10 1 2 0 2 0 4 3 5 4 7 0 10 2 10 3 6 3 7 1 4 0 9 1 4 3 8 1 10 1 10 0 3 2 5 3 9 0 7 4 5 0 1 0"],["2 3 0 3 0 1 0 5 3 4 3 5 4 5 0 8 0 5 2 6 3 8 7 9 2 8 3 8 5 6 5 9 3 6 1 4 2 7 3 6 2 3 1 5 0 7 3 7 0 3 1 7 3 7 1 9 5 9 5 8 7 8 5 6 5 8 1 9 8 9 8 10 7 10 5 8 6 10 2 6 3 9 2 6 3 10 5 9 3 10 1 3 2 11 8 9 8 10 1 8 7 11 0 9 5 8 4 5 0 7 3 7 5 9 5 10 1 7 1 9 1 6 3 8 2 4 1 4 2 6 0 4 2 4 2 7 6 9 0 1 0 4 0 4 0 9 2 7 6 7 2 8 0 8 2 7 5 10 1 2 0 2 0 4 3 5 4 7 0 10 2 10 3 6 3 7 1 4 0 9 1 4 3 8 1 10 1 10 0 3 2 5 3 9 0 7 4 5 0 1 0"]],[["98 3","1 2 1 2 0 2 0 2 1 2 0 1 0 2 1 2 0 2 1 2 1 2 0 1 0 2 1 2 1 2 0 2 1 2 0 2 0 2 0 1 0 1 0 1 0 2 1 3 1 2 1 2 1 2 1 2 1 2 1 2 0 2 0 2 1 2 1 2 0 2 1 2 0 1 0 1 0 1 0 1 0 2 0 1 0 2 0 2 1 2 1 2 1 2 0 1 0 1 0 1 0 2 1 2 0 2 1 2 0 2 0 1 0 2 1 2 0 1 0 2 1 2 1 2 1 2 0 2 1 2 1 2 1 2 0 2 1 2 1 2 0 1 0 2 0 2 0 1 0 2 0 2 0 1 0 1 0 1 0 2 0 2 1 2 0 1 0 2 0 2 0 1 0 2 1 2 1 2 1 2 0 2 1 2 1 2 1 2 0 1 0 1 0 2 0 2 0"],["1 2 1 2 0 1 0 2 1 2 0 1 0 2 1 2 0 2 1 2 1 2 0 1 0 2 1 2 1 2 0 2 1 2 0 1 0 1 0 1 0 1 0 1 0 2 1 3 1 2 1 2 1 2 1 2 1 2 1 2 0 2 0 2 1 2 1 2 0 2 1 2 0 1 0 1 0 1 0 1 0 2 0 1 0 2 0 2 1 2 1 2 1 2 0 1 0 1 0 1 0 2 1 2 0 2 1 2 0 2 0 1 0 2 1 2 0 1 0 2 1 2 1 2 1 2 0 2 1 2 1 2 1 2 0 2 1 2 1 2 0 1 0 2 0 2 0 1 0 2 0 2 0 1 0 1 0 1 0 2 0 2 1 2 0 1 0 2 0 2 0 1 0 2 1 2 1 2 1 2 0 2 1 2 1 2 1 2 0 1 0 1 0 2 0 2 0"]],[["2 1","0 2 1 4 1"],["0 2 1 3 1"]],[["2 1","0 2 1 5 1"],["0 2 1 4 1"]],[["3 3","1 12 9 11 6 8 1"],["1 11 9 10 6 7 1"]],[["3 2","0 7 4 7 1 3 2"],["0 6 4 6 1 3 2"]],[["2 1","1 3 2 4 1"],["1 3 2 3 1"]],[["4 1","5 6 5 6 5 6 1 3 1"],["5 6 5 6 5 6 1 2 1"]],[["2 1","0 2 1 3 0"],["0 2 1 2 0"]],[["2 2","98 100 1 7 2"],["98 99 1 6 2"]],[["3 1","8 10 9 10 3 5 1"],["8 10 9 10 3 4 1"]],[["3 2","0 4 3 5 2 5 2"],["0 4 3 4 2 4 2"]],[["2 1","4 5 2 4 2"],["4 5 2 3 2"]],[["3 1","0 2 1 2 0 2 0"],["0 2 1 2 0 1 0"]],[["1 1","5 7 2"],["5 6 2"]],[["2 1","3 4 1 3 1"],["3 4 1 2 1"]],[["3 1","0 4 3 5 0 5 0"],["0 4 3 4 0 5 0"]],[["3 1","1 3 2 3 1 3 1"],["1 3 2 3 1 2 1"]],[["2 1","0 8 7 100 0"],["0 8 7 99 0"]],[["2 1","1 3 2 5 1"],["1 3 2 4 1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_91","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate int n and d\ncreate int a[105]\ndefine the main function\n while read n and d\n for i=0 to n exclusive, read a[i]\n sort elements between a and a + n\n maxlen=0\n for i=0 to n exclusive\n thislen = 1\n for j=i+1 to n exclusive\n if a[j] - a[i] > d, break\n increment thislen\n end of the block\n set maxlen to max(thislen, maxlen)\n end of the block\n print n - maxlen\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int n, d;\nint a[105];\nint main() {\n while (cin >> n >> d) {\n for (int i = 0; i < n; ++i) cin >> a[i];\n sort(a, a + n);\n int maxlen = 0;\n for (int i = 0; i < n; ++i) {\n int thislen = 1;\n for (int j = i + 1; j < n; ++j) {\n if (a[j] - a[i] > d) break;\n thislen++;\n }\n maxlen = max(thislen, maxlen);\n }\n cout << n - maxlen << endl;\n }\n return 0;\n}","item":{"problem_id":"940A","pseudocode":"create int n and d\ncreate int a[105]\ndefine the main function\n while read n and d\n for i=0 to n exclusive, read a[i]\n sort elements between a and a + n\n maxlen=0\n for i=0 to n exclusive\n thislen = 1\n for j=i+1 to n exclusive\n if a[j] - a[i] > d, break\n increment thislen\n end of the block\n set maxlen to max(thislen, maxlen)\n end of the block\n print n - maxlen\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["3 1","2 1 4"],["1"]],[["3 0","7 7 7"],["0"]],[["6 3","1 3 4 6 9 10"],["3"]],[["11 5","10 11 12 13 14 15 16 17 18 19 20"],["5"]],[["1 100","1"],["0"]],[["100 10","22 75 26 45 72 81 47 29 97 2 75 25 82 84 17 56 32 2 28 37 57 39 18 11 79 6 40 68 68 16 40 63 93 49 91 10 55 68 31 80 57 18 34 28 76 55 21 80 22 45 11 67 67 74 91 4 35 34 65 80 21 95 1 52 25 31 2 53 96 22 89 99 7 66 32 2 68 33 75 92 84 10 94 28 54 12 9 80 43 21 51 92 20 97 7 25 67 17 38 100"],["84"]],[["100 70","22 75 26 45 72 81 47 29 97 2 75 25 82 84 17 56 32 2 28 37 57 39 18 11 79 6 40 68 68 16 40 63 93 49 91 10 55 68 31 80 57 18 34 28 76 55 21 80 22 45 11 67 67 74 91 4 35 34 65 80 21 95 1 52 25 31 2 53 96 22 89 99 7 66 32 2 68 33 75 92 84 10 94 28 54 12 9 80 43 21 51 92 20 97 7 25 67 17 38 100"],["27"]],[["1 10","25"],["0"]],[["70 80","1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70"],["0"]],[["3 1","25 26 27"],["1"]],[["100 5","51 56 52 60 52 53 52 60 56 54 55 50 53 51 57 53 52 54 54 52 51 55 50 56 60 51 58 50 60 59 50 54 60 55 55 57 54 59 59 55 55 52 56 57 59 54 53 57 52 50 50 55 59 54 54 56 51 58 52 51 56 56 58 56 54 54 57 52 51 58 56 57 54 59 58 53 50 52 50 60 57 51 54 59 54 54 52 55 53 55 51 53 52 54 51 56 55 53 58 56"],["34"]],[["100 11","44 89 57 64 94 96 73 96 55 52 91 73 73 93 51 62 63 85 43 75 60 78 98 55 80 84 65 75 61 88 62 71 53 57 94 85 60 96 66 96 61 72 97 64 51 44 63 82 67 86 60 57 74 85 57 79 61 94 86 78 84 56 60 75 91 91 92 62 89 85 79 57 76 97 65 56 46 78 51 69 50 52 85 80 76 71 81 51 90 71 77 60 63 62 84 59 79 84 69 81"],["70"]],[["100 0","22 75 26 45 72 81 47 29 97 2 75 25 82 84 17 56 32 2 28 37 57 39 18 11 79 6 40 68 68 16 40 63 93 49 91 10 55 68 31 80 57 18 34 28 76 55 21 80 22 45 11 67 67 74 91 4 35 34 65 80 21 95 1 52 25 31 2 53 96 22 89 99 7 66 32 2 68 33 75 92 84 10 94 28 54 12 9 80 43 21 51 92 20 97 7 25 67 17 38 100"],["96"]],[["100 100","22 75 26 45 72 81 47 29 97 2 75 25 82 84 17 56 32 2 28 37 57 39 18 11 79 6 40 68 68 16 40 63 93 49 91 10 55 68 31 80 57 18 34 28 76 55 21 80 22 45 11 67 67 74 91 4 35 34 65 80 21 95 1 52 25 31 2 53 96 22 89 99 7 66 32 2 68 33 75 92 84 10 94 28 54 12 9 80 43 21 51 92 20 97 7 25 67 17 38 100"],["0"]],[["76 32","50 53 69 58 55 39 40 42 40 55 58 73 55 72 75 44 45 55 46 60 60 42 41 64 77 39 68 51 61 49 38 41 56 57 64 43 78 36 39 63 40 66 52 76 39 68 39 73 40 68 54 60 35 67 69 52 58 52 38 63 69 38 69 60 73 64 65 41 59 55 37 57 40 34 35 35"],["13"]],[["100 1","22 75 26 45 72 81 47 29 97 2 75 25 82 84 17 56 32 2 28 37 57 39 18 11 79 6 40 68 68 16 40 63 93 49 91 10 55 68 31 80 57 18 34 28 76 55 21 80 22 45 11 67 67 74 91 4 35 34 65 80 21 95 1 52 25 31 2 53 96 22 89 99 7 66 32 2 68 33 75 92 84 10 94 28 54 12 9 80 43 21 51 92 20 97 7 25 67 17 38 100"],["93"]],[["100 5","22 75 26 45 72 81 47 29 97 2 75 25 82 84 17 56 32 2 28 37 57 39 18 11 79 6 40 68 68 16 40 63 93 49 91 10 55 68 31 80 57 18 34 28 76 55 21 80 22 45 11 67 67 74 91 4 35 34 65 80 21 95 1 52 25 31 2 53 96 22 89 99 7 66 32 2 68 33 75 92 84 10 94 28 54 12 9 80 43 21 51 92 20 97 7 25 67 17 38 100"],["89"]],[["98 64","2 29 36 55 58 15 25 33 7 16 61 1 4 24 63 26 36 16 16 3 57 39 56 7 11 24 20 12 22 10 56 5 11 39 61 52 27 54 21 6 61 36 40 52 54 5 15 52 58 23 45 39 65 16 27 40 13 64 47 24 51 29 9 18 49 49 8 47 2 64 7 63 49 10 20 26 34 3 45 66 8 46 16 32 16 38 3 6 15 17 35 48 36 5 57 29 61 15"],["1"]],[["100 56","1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100"],["43"]],[["100 0","14 13 14 13 14 13 13 13 13 14 13 13 14 14 13 14 14 14 14 13 13 13 14 13 13 14 14 14 14 14 14 13 13 13 13 14 13 14 13 14 13 14 14 14 14 13 13 14 14 13 13 13 13 14 13 14 13 14 13 14 13 13 13 14 13 13 14 13 14 14 13 13 13 14 14 14 14 13 13 14 14 14 14 14 14 14 13 14 13 13 13 14 14 13 13 13 13 13 14 14"],["50"]],[["100 0","14 17 18 22 19 18 19 21 19 19 22 22 19 21 24 23 24 19 25 24 24 21 20 13 26 18 17 15 25 13 17 20 20 21 13 22 27 15 18 27 19 15 16 25 18 17 18 22 19 17 18 24 14 16 18 16 22 16 17 27 18 17 18 24 22 13 14 20 23 19 16 21 19 13 14 14 25 15 27 24 26 22 16 20 16 14 21 27 15 23 23 24 27 14 24 17 19 24 15 27"],["89"]],[["100 100","100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100"],["0"]],[["1 100","22"],["0"]],[["1 0","22"],["0"]],[["1 99","99"],["0"]],[["1 5","6"],["0"]],[["3 1","10 20 30"],["2"]],[["3 0","1 2 3"],["2"]],[["3 2","1 50 99"],["2"]],[["7 4","1 3 4 9 10 11 12"],["3"]],[["2 5","67 23"],["1"]],[["4 2","1 4 7 9"],["2"]],[["2 0","1 2"],["1"]],[["8 1","3 3 3 5 5 5 5 5"],["3"]],[["5 1","3 5 5 5 6"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_92","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let n be a long integer\n read n\n if n modulo 2 is equal to 0\n print 2 and newline\n else do the following\n print 1 and newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long n;\n cin >> n;\n if (n % 2 == 0)\n cout << 2 << endl;\n else\n cout << 1 << endl;\n return 0;\n}","item":{"problem_id":"630R","pseudocode":"define the main function\n let n be a long integer\n read n\n if n modulo 2 is equal to 0\n print 2 and newline\n else do the following\n print 1 and newline\n return to indicate successful execution\nend of the block","testcases":[[["1"],["1"]],[["2"],["2"]],[["3"],["1"]],[["4"],["2"]],[["5"],["1"]],[["1000000000000000000"],["2"]],[["999999999999999999"],["1"]],[["321392715309062180"],["2"]],[["95451113283177888"],["2"]],[["25496382240130775"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_93","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integers n, x, sum and cont with sum and cont = 0, and an array a with size 1005\n read variables n and x from the input\n for i from 0 to n exclusive incrementing i\n read standard input to a[i]\n increase sum by a[i]\n end of the block\n declare integer baad with value x\n change sum to it's absolute value\n while sum is not 0\n while sum < x, decrement x\n subtract x from sum\n increment cont by one\n end of the block\n print cont\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, x, a[1005], sum = 0, cont = 0;\n cin >> n >> x;\n for (int i = 0; i < n; i++) {\n cin >> a[i];\n sum += a[i];\n }\n int baad = x;\n sum = abs(sum);\n while (sum != 0) {\n while (sum < x) x--;\n sum -= x;\n cont++;\n }\n cout << cont << endl;\n return 0;\n}","item":{"problem_id":"401A","pseudocode":"define the main function\n create integers n, x, sum and cont with sum and cont = 0, and an array a with size 1005\n read variables n and x from the input\n for i from 0 to n exclusive incrementing i\n read standard input to a[i]\n increase sum by a[i]\n end of the block\n declare integer baad with value x\n change sum to it's absolute value\n while sum is not 0\n while sum < x, decrement x\n subtract x from sum\n increment cont by one\n end of the block\n print cont\n return to indicate successful execution\nend of the block","testcases":[[["3 2","-1 1 2"],["1"]],[["2 3","-2 -2"],["2"]],[["4 4","1 2 3 4"],["3"]],[["2 2","-1 -1"],["1"]],[["15 5","-2 -1 2 -4 -3 4 -4 -2 -2 2 -2 -1 1 -4 -2"],["4"]],[["15 16","-15 -5 -15 -14 -8 15 -15 -12 -5 -3 5 -7 3 8 -15"],["6"]],[["1 4","-3"],["1"]],[["10 7","6 4 6 6 -3 4 -1 2 3 3"],["5"]],[["2 1","1 -1"],["0"]],[["1 1","0"],["0"]],[["8 13","-11 -1 -11 12 -2 -2 -10 -11"],["3"]],[["16 11","3 -7 7 -9 -2 -3 -4 -2 -6 8 10 7 1 4 6 7"],["2"]],[["67 15","-2 -2 6 -4 -7 4 3 13 -9 -4 11 -7 -6 -11 1 11 -1 11 14 10 -8 7 5 11 -13 1 -1 7 -14 9 -11 -11 13 -4 12 -11 -8 -5 -11 6 10 -2 6 9 9 6 -11 -2 7 -10 -1 9 -8 -5 1 -7 -2 3 -1 -13 -6 -9 -8 10 13 -3 9"],["1"]],[["123 222","44 -190 -188 -185 -55 17 190 176 157 176 -24 -113 -54 -61 -53 53 -77 68 -12 -114 -217 163 -122 37 -37 20 -108 17 -140 -210 218 19 -89 54 18 197 111 -150 -36 -131 -172 36 67 16 -202 72 169 -137 -34 -122 137 -72 196 -17 -104 180 -102 96 -69 -184 21 -15 217 -61 175 -221 62 173 -93 -106 122 -135 58 7 -110 -108 156 -141 -102 -50 29 -204 -46 -76 101 -33 -190 99 52 -197 175 -71 161 -140 155 10 189 -217 -97 -170 183 -88 83 -149 157 -208 154 -3 77 90 74 165 198 -181 -166 -4 -200 -89 -200 131 100 -61 -149"],["8"]],[["130 142","58 -50 43 -126 84 -92 -108 -92 57 127 12 -135 -49 89 141 -112 -31 47 75 -19 80 81 -5 17 10 4 -26 68 -102 -10 7 -62 -135 -123 -16 55 -72 -97 -34 21 21 137 130 97 40 -18 110 -52 73 52 85 103 -134 -107 88 30 66 97 126 82 13 125 127 -87 81 22 45 102 13 95 4 10 -35 39 -43 -112 -5 14 -46 19 61 -44 -116 137 -116 -80 -39 92 -75 29 -65 -15 5 -108 -114 -129 -5 52 -21 118 -41 35 -62 -125 130 -95 -11 -75 19 108 108 127 141 2 -130 54 96 -81 -102 140 -58 -102 132 50 -126 82 6 45 -114 -42"],["5"]],[["7 12","2 5 -1 -4 -7 4 3"],["1"]],[["57 53","-49 7 -41 7 38 -51 -23 8 45 1 -24 26 37 28 -31 -40 38 25 -32 -47 -3 20 -40 -32 -44 -36 5 33 -16 -5 28 10 -22 3 -10 -51 -32 -51 27 -50 -22 -12 41 3 15 24 30 -12 -34 -15 -29 38 -10 -35 -9 6 -51"],["8"]],[["93 273","-268 -170 -163 19 -69 18 -244 35 -34 125 -224 -48 179 -247 127 -150 271 -49 -102 201 84 -151 -70 -46 -16 216 240 127 3 218 -209 223 -227 -201 228 -8 203 46 -100 -207 126 255 40 -58 -217 93 172 -97 23 183 102 -92 -157 -117 173 47 144 -235 -227 -62 -128 13 -151 158 110 -116 68 -2 -148 -206 -52 79 -152 -223 74 -149 -69 232 38 -70 -256 -213 -236 132 -189 -200 199 -57 -108 -53 269 -101 -134"],["8"]],[["1 1000","997"],["1"]],[["4 3","2 -1 -2 -1"],["1"]],[["1 1","-1"],["1"]],[["1 1","1"],["1"]],[["2 2","1 -1"],["0"]],[["2 2","-1 1"],["0"]],[["2 3","-1 1"],["0"]],[["2 2","-2 2"],["0"]],[["2 2","2 2"],["2"]],[["4 2","-1 -1 -1 -1"],["2"]],[["4 1","-1 -1 -1 1"],["2"]],[["3 2","2 2 2"],["3"]],[["10 300","300 300 300 300 300 300 300 300 300 300"],["10"]]]}} +{"instance_id":"pseudo_to_code_0.5k_94","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare new int variables player1, player2 and player3\ndeclare integer variable with name n\nnew integer variable a\ndefine the main function\n read n from the input\n assign 1 to player1\n set player2 to 2\n change player3 to 3\n loop, decrementing n, while it is not 0\n read from the input to a\n if a is equal to player3\n print \"NO\\n\" to the standard output\n return to indicate successful execution\n end of the block\n if a = player1\n swap player3 and player2\n else\n swap player3 and player1\n end of the block\n print \"YES\\n\" to the standard output\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int player1, player2, player3;\nint n;\nint a;\nint main() {\n cin >> n;\n player1 = 1;\n player2 = 2;\n player3 = 3;\n while (n--) {\n cin >> a;\n if (a == player3) {\n cout << \"NO\\n\";\n return 0;\n }\n if (a == player1)\n swap(player3, player2);\n else\n swap(player3, player1);\n }\n cout << \"YES\\n\";\n return 0;\n}","item":{"problem_id":"893A","pseudocode":"declare new int variables player1, player2 and player3\ndeclare integer variable with name n\nnew integer variable a\ndefine the main function\n read n from the input\n assign 1 to player1\n set player2 to 2\n change player3 to 3\n loop, decrementing n, while it is not 0\n read from the input to a\n if a is equal to player3\n print \"NO\\n\" to the standard output\n return to indicate successful execution\n end of the block\n if a = player1\n swap player3 and player2\n else\n swap player3 and player1\n end of the block\n print \"YES\\n\" to the standard output\n return to indicate successful execution\nend of the block","testcases":[[["3","1","1","2"],["YES"]],[["2","1","2"],["NO"]],[["100","2","3","1","2","3","3","3","1","1","1","1","3","3","3","3","1","2","3","3","3","3","3","3","3","1","2","2","2","3","1","1","3","3","3","3","3","3","3","3","1","2","3","3","3","1","1","1","1","3","3","3","3","1","2","3","1","2","2","2","3","3","2","1","3","3","1","2","3","1","1","1","2","2","2","3","1","1","1","1","1","1","3","2","2","2","2","2","2","3","1","2","2","2","2","2","3","3","2","1","1"],["YES"]],[["99","1","3","2","2","3","1","1","3","3","3","3","3","3","1","1","3","3","3","3","1","1","3","2","1","1","1","1","1","1","1","3","2","2","2","1","3","3","1","1","3","2","1","3","3","1","2","3","3","3","1","2","2","2","3","3","3","3","3","3","2","2","2","2","3","3","3","1","1","3","2","1","1","2","2","2","3","3","2","1","1","2","2","1","3","2","1","1","2","3","3","3","3","2","2","2","2","2","1","3"],["YES"]],[["100","2","2","1","3","1","3","3","1","1","3","1","1","3","2","1","3","1","1","3","3","2","2","3","1","1","2","3","2","2","3","1","1","2","3","2","1","2","2","3","3","1","1","3","1","2","1","3","1","1","3","2","2","2","1","1","1","3","1","3","2","1","2","2","2","3","3","2","1","1","3","3","2","1","2","1","1","3","1","2","3","2","3","3","3","2","2","1","3","1","2","3","1","2","3","3","1","2","1","3","1"],["NO"]],[["10","2","3","3","3","3","2","2","2","3","2"],["NO"]],[["100","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1"],["YES"]],[["1","3"],["NO"]],[["1","2"],["YES"]],[["42","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1"],["YES"]],[["4","2","3","3","3"],["YES"]],[["3","1","2","3"],["NO"]],[["5","1","1","1","1","3"],["NO"]],[["5","2","3","3","3","3"],["YES"]],[["2","3","3"],["NO"]],[["4","1","2","2","1"],["NO"]],[["3","2","2","3"],["NO"]],[["5","2","3","3","1","1"],["NO"]],[["3","3","1","3"],["NO"]],[["3","3","3","1"],["NO"]],[["2","2","1"],["NO"]],[["3","1","1","3"],["NO"]],[["6","2","2","2","3","1","3"],["NO"]],[["2","3","1"],["NO"]],[["2","3","2"],["NO"]],[["2","1","3"],["YES"]],[["3","1","3","1"],["NO"]],[["5","1","1","2","2","3"],["NO"]],[["3","2","1","1"],["NO"]],[["2","2","2"],["YES"]],[["3","2","2","1"],["YES"]],[["5","2","2","2","2","2"],["YES"]],[["8","1","1","1","1","1","1","1","1"],["YES"]],[["3","3","2","2"],["NO"]],[["3","3","2","3"],["NO"]],[["7","2","2","2","2","2","2","2"],["YES"]],[["3","2","2","2"],["YES"]]]}} +{"instance_id":"pseudo_to_code_0.5k_95","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nn, m, a, b and c are long longs\ndeclare long longs Yellow, Blue and ans\ndefine the main function\n read n, m, a, b and c\n Yellow = a * 2 + b\n Blue = b + c * 3\n if Yellow >= n and Blue >= m\n increase ans by Yellow + Blue - n - m\n else if Yellow < n and Blue is greater than m\n increase ans by Blue - m\n else if Yellow > n and Blue is less than m\n increase ans by Yellow - n\n print ans and a new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"long long n, m, a, b, c;\nlong long Yellow, Blue, ans;\nint main() {\n cin >> n >> m >> a >> b >> c;\n Yellow = a * 2 + b;\n Blue = b + c * 3;\n if (Yellow >= n && Blue >= m)\n ans += Yellow + Blue - n - m;\n else if (Yellow < n && Blue > m)\n ans += Blue - m;\n else if (Yellow > n && Blue < m)\n ans += Yellow - n;\n cout << ans << endl;\n return 0;\n}","item":{"problem_id":"912A","pseudocode":"n, m, a, b and c are long longs\ndeclare long longs Yellow, Blue and ans\ndefine the main function\n read n, m, a, b and c\n Yellow = a * 2 + b\n Blue = b + c * 3\n if Yellow >= n and Blue >= m\n increase ans by Yellow + Blue - n - m\n else if Yellow < n and Blue is greater than m\n increase ans by Blue - m\n else if Yellow > n and Blue is less than m\n increase ans by Yellow - n\n print ans and a new line\n return to indicate successful execution\nend of the block","testcases":[[["4 3","2 1 1"],["2"]],[["3 9","1 1 3"],["1"]],[["12345678 87654321","43043751 1000000000 53798715"],["2147483648"]],[["12 12","3 5 2"],["0"]],[["770 1390","170 442 311"],["12"]],[["3555165 6693472","1499112 556941 3075290"],["3089339"]],[["0 0","1000000000 1000000000 1000000000"],["7000000000"]],[["1 1","0 1 0"],["0"]],[["117708228 562858833","118004008 360437130 154015822"],["738362681"]],[["999998118 700178721","822106746 82987112 547955384"],["1753877029"]],[["566568710 765371101","60614022 80126928 809950465"],["1744607222"]],[["448858599 829062060","764716760 97644201 203890025"],["1178219122"]],[["626115781 966381948","395190569 820194184 229233367"],["1525971878"]],[["803372962 103701834","394260597 837711458 623172928"],["3426388098"]],[["980630143 241021722","24734406 928857659 312079781"],["1624075280"]],[["862920032 378341609","360240924 241342224 337423122"],["974174021"]],[["40177212 515661496","64343660 963892207 731362684"],["3694721078"]],[["217434393 579352456","694817470 981409480 756706026"],["4825785129"]],[["394691574 716672343","398920207 72555681 150645586"],["475704521"]],[["276981463 853992230","29394015 90072954 839552440"],["1754738044"]],[["843552056 919184611","341530221 423649259 101547519"],["263157645"]],[["20809236 56504497","972004030 441166533 495487081"],["4235488636"]],[["198066417 825228166","602477839 532312735 520830423"],["2808777834"]],[["80356306 962548053","601547868 549830008 914769984"],["4004161345"]],[["257613487 394835231","642087093 567347282 308709545"],["2692548667"]],[["139903376 532155119","641157122 289897263 629020178"],["3077110809"]],[["612127849 669475006","271630930 676010757 22959739"],["682559736"]],[["0 0","0 0 0"],["0"]],[["1000000000 1000000000","499999998 4 333333332"],["0"]],[["1000000000 1000000000","1000000000 1000000000 1000000000"],["5000000000"]],[["4 3","1 0 1"],["0"]],[["4 12","1 2 3"],["0"]],[["4 20","1 2 1"],["0"]],[["100 10","2 3 4"],["5"]],[["6 0","1 1 1"],["4"]],[["25 5","3 3 3"],["7"]],[["48 27","22 39 20"],["107"]],[["4 0","1 1 1"],["4"]]]}} +{"instance_id":"pseudo_to_code_0.5k_96","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n x1, y1, x2, y2 = int\n read x1 then y1 then x2 then y2\n ans = int with ans = min of absolute x1 - x2 and absolute y1 - y2\n if absolute x1 - x2 is not ans\n add absolute of absolute of x2 - x1 - ans to ans\n else if absolute of y1 - y2 is not ans\n add absolute of absolute of y2 - y1 - ans to ans\n end of the block\n print ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int x1, y1, x2, y2;\n cin >> x1 >> y1 >> x2 >> y2;\n int ans = min(abs(x1 - x2), abs(y1 - y2));\n if (abs(x1 - x2) != ans) {\n ans += abs(abs(x2 - x1) - ans);\n } else if (abs(y1 - y2) != ans) {\n ans += abs(abs(y2 - y1) - ans);\n }\n cout << ans << '\\n';\n return 0;\n}","item":{"problem_id":"620A","pseudocode":"define the main function\n x1, y1, x2, y2 = int\n read x1 then y1 then x2 then y2\n ans = int with ans = min of absolute x1 - x2 and absolute y1 - y2\n if absolute x1 - x2 is not ans\n add absolute of absolute of x2 - x1 - ans to ans\n else if absolute of y1 - y2 is not ans\n add absolute of absolute of y2 - y1 - ans to ans\n end of the block\n print ans\n return to indicate successful execution\nend of the block","testcases":[[["0 0","4 5"],["5"]],[["3 4","6 1"],["3"]],[["0 0","4 6"],["6"]],[["1 1","-3 -5"],["6"]],[["-1 -1","-10 100"],["101"]],[["1 -1","100 -100"],["99"]],[["-1000000000 -1000000000","1000000000 1000000000"],["2000000000"]],[["-1000000000 -1000000000","0 999999999"],["1999999999"]],[["0 0","2 1"],["2"]],[["10 0","100 0"],["90"]],[["1 5","6 4"],["5"]],[["0 0","5 4"],["5"]],[["10 1","20 1"],["10"]],[["1 1","-3 4"],["4"]],[["-863407280 504312726","786535210 -661703810"],["1649942490"]],[["-588306085 -741137832","341385643 152943311"],["929691728"]],[["0 0","4 0"],["4"]],[["93097194 -48405232","-716984003 -428596062"],["810081197"]],[["9 1","1 1"],["8"]],[["4 6","0 4"],["4"]],[["2 4","5 2"],["3"]],[["-100000000 -100000000","100000000 100000123"],["200000123"]],[["5 6","5 7"],["1"]],[["12 16","12 1"],["15"]],[["0 0","5 1"],["5"]],[["0 1","1 1"],["1"]],[["-44602634 913365223","-572368780 933284951"],["527766146"]],[["-2 0","2 -2"],["4"]],[["0 0","3 1"],["3"]],[["-458 2","1255 4548"],["4546"]],[["-5 -4","-3 -3"],["2"]],[["4 5","7 3"],["3"]],[["-1000000000 -999999999","1000000000 999999998"],["2000000000"]],[["-1000000000 -1000000000","1000000000 -1000000000"],["2000000000"]],[["-464122675 -898521847","656107323 -625340409"],["1120229998"]],[["-463154699 -654742385","-699179052 -789004997"],["236024353"]],[["982747270 -593488945","342286841 -593604186"],["640460429"]],[["-80625246 708958515","468950878 574646184"],["549576124"]],[["0 0","1 0"],["1"]],[["109810 1","2 3"],["109808"]],[["-9 0","9 9"],["18"]],[["9 9","9 9"],["0"]],[["1 1","4 3"],["3"]],[["1 2","45 1"],["44"]],[["207558188 -313753260","-211535387 -721675423"],["419093575"]],[["-11 0","0 0"],["11"]],[["-1000000000 1000000000","1000000000 -1000000000"],["2000000000"]],[["0 0","1 1"],["1"]],[["0 0","0 1"],["1"]],[["0 0","-1 1"],["1"]],[["0 0","-1 0"],["1"]],[["0 0","-1 -1"],["1"]],[["0 0","0 -1"],["1"]],[["0 0","1 -1"],["1"]],[["10 90","90 10"],["80"]],[["851016864 573579544","-761410925 -380746263"],["1612427789"]],[["1 9","9 9"],["8"]],[["1000 1000","1000 1000"],["0"]],[["1 9","9 1"],["8"]],[["1 90","90 90"],["89"]],[["100 100","1000 1000"],["900"]],[["-1 0","0 0"],["1"]],[["-750595959 -2984043","649569876 -749608783"],["1400165835"]],[["958048496 712083589","423286949 810566863"],["534761547"]],[["146316710 53945094","-523054748 147499505"],["669371458"]],[["50383856 -596516251","-802950224 -557916272"],["853334080"]],[["-637204864 -280290367","-119020929 153679771"],["518183935"]],[["-100 -100","-60 -91"],["40"]],[["337537326 74909428","-765558776 167951547"],["1103096102"]],[["0 81","18 90"],["18"]],[["283722202 -902633305","-831696497 -160868946"],["1115418699"]],[["1000 1000","-1000 1000"],["2000"]],[["5 6","4 8"],["2"]],[["40572000 597493595","-935051731 368493185"],["975623731"]],[["-5 5","5 5"],["10"]]]}} +{"instance_id":"pseudo_to_code_0.5k_97","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n integers = n,i,j,k\n integers = array x any y with size of 101\n while inputting n do\n for = 0 to less than or equal to 100 set x[i] = y[i] = 0\n for = 0 to less than n do the following\n read j,k\n add one to x[j]\n add one to y[k]\n end of the block\n set j to k\n for = 0 to less than or equal to 100 do the following\n if x[i] is true\n if y[i] is true\n end of the block\n output j if j < k else output k\n output endl\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, i, j, k;\n int x[101], y[101];\n while (cin >> n) {\n for (i = 0; i <= 100; i++) { x[i] = y[i] = 0; }\n for (i = 0; i < n; i++) {\n cin >> j >> k;\n x[j]++;\n y[k]++;\n }\n j = k = 0;\n for (i = 0; i <= 100; i++) {\n if (x[i]) j++;\n if (y[i]) k++;\n }\n cout << (j < k ? j : k);\n cout << endl;\n }\n return 0;\n}","item":{"problem_id":"390A","pseudocode":"define the main function\n integers = n,i,j,k\n integers = array x any y with size of 101\n while inputting n do\n for = 0 to less than or equal to 100 set x[i] = y[i] = 0\n for = 0 to less than n do the following\n read j,k\n add one to x[j]\n add one to y[k]\n end of the block\n set j to k\n for = 0 to less than or equal to 100 do the following\n if x[i] is true\n if y[i] is true\n end of the block\n output j if j < k else output k\n output endl\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["4","0 0","0 1","0 2","1 0"],["2"]],[["4","0 0","0 1","1 0","1 1"],["2"]],[["4","1 1","1 2","2 3","3 3"],["3"]],[["1","0 0"],["1"]],[["42","28 87","26 16","59 90","47 61","28 83","36 30","67 10","6 95","9 49","86 94","52 24","74 9","86 24","28 51","25 99","40 98","57 33","18 96","43 36","3 79","4 86","38 61","25 61","6 100","58 81","28 19","64 4","3 40","2 56","41 49","97 100","86 34","42 36","44 40","14 85","21 60","76 99","64 47","69 13","49 37","97 37","3 70"],["31"]],[["21","54 85","69 37","42 87","53 18","28 22","13 3","62 97","38 91","67 19","100 79","29 18","48 40","68 84","44 20","37 34","73 53","21 5","20 73","24 94","23 52","7 55"],["20"]],[["19","1 1","1 2","1 3","1 4","1 5","1 6","1 7","1 8","1 9","1 10","1 11","1 12","1 13","1 14","1 15","1 16","1 17","1 18","1 19"],["1"]],[["12","1 1","1 3","1 5","2 1","2 2","2 4","3 1","3 3","3 5","4 1","4 2","4 3"],["4"]]]}} +{"instance_id":"pseudo_to_code_0.5k_98","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate pair array of int and int a of size 10001\ndeclare drom taking in int r and returning integer\n if a[r].first is not 0\n create int u = r\n set r to a[r].first\n if a[r].second is not 0\n set a[r].second to min of a[r].second and a[u]second\n else do\n set a[r].second to a[u].second\n set a[u].first to 0\n else\n return r\n set r to return value of drom(r)\n return r\nend of the block\nmake ints n, t, and l\ndefine the main function\n read n and t\n while t is not equal to 0\n make ints x, y, and z\n read x, y, and z\n set a[x].first to y\n set a[x].second to z\n decrease t by 1\n end of the block\n for i = 1 to n\n make int m = drom(i)\n if m is not equal to i\n set a[i].first to m\n set a[i].second to a[m].second\n else do\n set first value of a[i] to 0\n end of the block\n end of the block\n for i = 1 to n\n if a[i].first is not equal to 0, increment l\n print l\n for i = 1 to n\n if a[i].first is not equal to 0, print i, \" \", a[i].first, \" \", and a[i].second\nend of the block\n\n[CODE]:","reference_output":"pair a[10001];\nint drom(int r) {\n if (a[r].first != 0) {\n int u = r;\n r = a[r].first;\n if (a[r].second != 0)\n a[r].second = min(a[r].second, a[u].second);\n else\n a[r].second = a[u].second;\n a[u].first = 0;\n } else\n return r;\n r = drom(r);\n return r;\n}\nint n, t, l;\nint main() {\n cin >> n >> t;\n while (t != 0) {\n int x, y, z;\n cin >> x >> y >> z;\n a[x].first = y;\n a[x].second = z;\n t--;\n }\n for (int i = 1; i <= n; ++i) {\n int m = drom(i);\n if (m != i) {\n a[i].first = m;\n a[i].second = a[m].second;\n } else {\n a[i].first = 0;\n }\n }\n for (int i = 1; i <= n; ++i)\n if (a[i].first != 0) l++;\n cout << l << endl;\n for (int i = 1; i <= n; ++i)\n if (a[i].first != 0) cout << i << \" \" << a[i].first << \" \" << a[i].second << endl;\n}","item":{"problem_id":"107A","pseudocode":"create pair array of int and int a of size 10001\ndeclare drom taking in int r and returning integer\n if a[r].first is not 0\n create int u = r\n set r to a[r].first\n if a[r].second is not 0\n set a[r].second to min of a[r].second and a[u]second\n else do\n set a[r].second to a[u].second\n set a[u].first to 0\n else\n return r\n set r to return value of drom(r)\n return r\nend of the block\nmake ints n, t, and l\ndefine the main function\n read n and t\n while t is not equal to 0\n make ints x, y, and z\n read x, y, and z\n set a[x].first to y\n set a[x].second to z\n decrease t by 1\n end of the block\n for i = 1 to n\n make int m = drom(i)\n if m is not equal to i\n set a[i].first to m\n set a[i].second to a[m].second\n else do\n set first value of a[i] to 0\n end of the block\n end of the block\n for i = 1 to n\n if a[i].first is not equal to 0, increment l\n print l\n for i = 1 to n\n if a[i].first is not equal to 0, print i, \" \", a[i].first, \" \", and a[i].second\nend of the block","testcases":[[["3 2","1 2 10","2 3 20"],["1","1 3 10"]],[["3 3","1 2 20","2 3 10","3 1 5"],["0"]],[["4 2","1 2 60","3 4 50"],["2","1 2 60","3 4 50"]],[["10 10","10 3 70","1 9 98","9 10 67","5 2 78","8 6 71","4 8 95","7 1 10","2 5 73","6 7 94","3 4 23"],["0"]],[["7 5","3 2 26","4 6 84","6 3 82","5 1 57","1 7 34"],["2","4 2 26","5 7 34"]],[["9 6","7 4 98","5 9 72","4 6 10","2 8 22","9 7 17","3 1 66"],["3","2 8 22","3 1 66","5 6 10"]],[["8 6","1 3 84","8 4 34","7 2 10","6 8 8","3 5 39","2 7 8"],["2","1 5 39","6 4 8"]],[["10 8","2 3 49","4 8 26","5 2 76","3 5 94","1 7 16","10 9 77","6 4 24","7 1 7"],["2","6 8 24","10 9 77"]],[["6 5","2 6 47","3 4 27","5 2 47","4 1 62","1 5 61"],["1","3 6 27"]],[["5 4","5 2 9","4 1 94","3 5 82","2 3 58"],["1","4 1 94"]],[["1000 0"],["0"]],[["2 2","1 2 1","2 1 1"],["0"]],[["44 42","4 37 166","34 25 47","28 19 367","20 14 811","8 3 878","39 1 925","35 9 206","32 18 841","16 44 503","5 20 426","22 34 896","44 43 471","17 33 577","40 22 317","24 31 818","37 11 292","21 39 888","6 8 983","43 36 170","11 21 662","36 17 942","18 7 356","2 32 220","12 5 774","19 27 193","13 40 63","15 10 510","30 35 869","41 24 736","42 4 180","23 41 261","9 28 501","29 15 983","10 30 638","7 13 402","26 12 754","25 6 597","27 29 57","1 16 933","31 42 135","33 38 718","14 23 361"],["2","2 3 47","26 38 135"]],[["35 33","22 7 978","5 6 566","20 10 198","6 17 170","7 27 627","24 19 659","31 30 130","34 8 365","23 12 716","4 29 217","8 20 156","26 35 142","3 2 419","15 1 448","17 24 91","18 33 962","30 22 822","9 16 847","2 9 470","10 25 981","16 31 359","19 28 283","28 34 199","11 5 660","25 23 176","29 18 235","12 14 765","14 11 81","27 21 61","21 13 651","35 3 583","1 32 767","13 4 256"],["2","15 32 448","26 33 61"]],[["33 28","12 15 574","11 13 714","13 33 62","9 28 391","22 19 235","6 20 655","23 9 25","8 29 994","21 30 133","17 18 170","32 7 470","14 21 418","7 31 431","3 1 185","1 14 538","33 12 250","31 22 694","2 27 945","16 26 584","19 32 317","27 2 904","15 25 748","29 3 754","24 4 287","18 10 775","30 11 401","10 8 653","28 5 70"],["5","6 20 655","16 26 584","17 25 62","23 5 25","24 4 287"]],[["3 1","1 2 10"],["1","1 2 10"]],[["1 0"],["0"]],[["2 0"],["0"]],[["3 0"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_99","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n = integer\n read n\n for i = 0 to i * (i - 1) \/ 2 <= n\n if i * (i - 1) \/ 2 is equal to n return !(cout << \"YES\\n\")\n return !(cout << \"NO\\n\")\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n for (int i = 0; i * (i - 1) \/ 2 <= n; i++)\n if (i * (i - 1) \/ 2 == n) return !(cout << \"YES\\n\");\n return !(cout << \"NO\\n\");\n}","item":{"problem_id":"47A","pseudocode":"define the main function\n n = integer\n read n\n for i = 0 to i * (i - 1) \/ 2 <= n\n if i * (i - 1) \/ 2 is equal to n return !(cout << \"YES\\n\")\n return !(cout << \"NO\\n\")\nend of the block","testcases":[[["1"],["YES"]],[["2"],["NO"]],[["3"],["YES"]],[["4"],["NO"]],[["5"],["NO"]],[["6"],["YES"]],[["7"],["NO"]],[["8"],["NO"]],[["12"],["NO"]],[["10"],["YES"]],[["11"],["NO"]],[["9"],["NO"]],[["14"],["NO"]],[["15"],["YES"]],[["16"],["NO"]],[["20"],["NO"]],[["21"],["YES"]],[["22"],["NO"]],[["121"],["NO"]],[["135"],["NO"]],[["136"],["YES"]],[["137"],["NO"]],[["152"],["NO"]],[["153"],["YES"]],[["154"],["NO"]],[["171"],["YES"]],[["189"],["NO"]],[["190"],["YES"]],[["191"],["NO"]],[["210"],["YES"]],[["211"],["NO"]],[["231"],["YES"]],[["232"],["NO"]],[["252"],["NO"]],[["253"],["YES"]],[["254"],["NO"]],[["275"],["NO"]],[["276"],["YES"]],[["277"],["NO"]],[["299"],["NO"]],[["300"],["YES"]],[["301"],["NO"]],[["324"],["NO"]],[["325"],["YES"]],[["326"],["NO"]],[["350"],["NO"]],[["351"],["YES"]],[["352"],["NO"]],[["377"],["NO"]],[["378"],["YES"]],[["406"],["YES"]],[["434"],["NO"]],[["435"],["YES"]],[["464"],["NO"]],[["465"],["YES"]],[["495"],["NO"]],[["496"],["YES"]],[["497"],["NO"]],[["331"],["NO"]],[["413"],["NO"]],[["177"],["NO"]],[["122"],["NO"]],[["478"],["NO"]],[["188"],["NO"]],[["21"],["YES"]],[["474"],["NO"]],[["21"],["YES"]],[["48"],["NO"]],[["498"],["NO"]],[["499"],["NO"]],[["500"],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_100","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare long long k\ndeclare vector of long longs v\nin the function d with long long argument n\n declare long long variable c = 0\n for i = 1 while i * i <= n\n if n % i = 0\n push i to the end of v\n if n \/ i != i push n \/ i to the end of v\n end of the block\n end of the block\n sort v\n if length of v is less than k\n print \"-1\"\n else\n print v[k - 1]\nend of the block\ndefine the main function\n create long long n\n read n and k\n invoke function d with argument n\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"long long k;\nvector v;\nvoid d(long long n) {\n long long c = 0;\n for (long long i = 1; i * i <= n; i++) {\n if (n % i == 0) {\n v.push_back(i);\n if (n \/ i != i) v.push_back(n \/ i);\n }\n }\n sort(v.begin(), v.end());\n if (v.size() < k)\n cout << \"-1\" << endl;\n else\n cout << v[k - 1] << endl;\n}\nint main() {\n long long n;\n cin >> n >> k;\n d(n);\n return 0;\n}","item":{"problem_id":"762A","pseudocode":"declare long long k\ndeclare vector of long longs v\nin the function d with long long argument n\n declare long long variable c = 0\n for i = 1 while i * i <= n\n if n % i = 0\n push i to the end of v\n if n \/ i != i push n \/ i to the end of v\n end of the block\n end of the block\n sort v\n if length of v is less than k\n print \"-1\"\n else\n print v[k - 1]\nend of the block\ndefine the main function\n create long long n\n read n and k\n invoke function d with argument n\n return to indicate successful execution\nend of the block","testcases":[[["4 2"],["2"]],[["5 3"],["-1"]],[["12 5"],["6"]],[["1 1"],["1"]],[["866421317361600 26880"],["866421317361600"]],[["866421317361600 26881"],["-1"]],[["1000000000000000 1000000000"],["-1"]],[["1000000000000000 100"],["1953125"]],[["1 2"],["-1"]],[["4 3"],["4"]],[["4 4"],["-1"]],[["9 3"],["9"]],[["21 3"],["7"]],[["67280421310721 1"],["1"]],[["6 3"],["3"]],[["3 3"],["-1"]],[["16 3"],["4"]],[["1 1000"],["-1"]],[["16 4"],["8"]],[["36 8"],["18"]],[["49 4"],["-1"]],[["9 4"],["-1"]],[["16 1"],["1"]],[["16 6"],["-1"]],[["16 5"],["16"]],[["25 4"],["-1"]],[["4010815561 2"],["63331"]],[["49 3"],["49"]],[["36 6"],["9"]],[["36 10"],["-1"]],[["25 3"],["25"]],[["22876792454961 28"],["7625597484987"]],[["1234 2"],["2"]],[["179458711 2"],["179458711"]],[["900104343024121 100000"],["-1"]],[["8 3"],["4"]],[["100 6"],["20"]],[["15500 26"],["-1"]],[["111111 1"],["1"]],[["100000000000000 200"],["160000000000"]],[["1000000000000 100"],["6400000"]],[["100 10"],["-1"]],[["1000000000039 2"],["1000000000039"]],[["64 5"],["16"]],[["999999961946176 33"],["63245552"]],[["376219076689 3"],["376219076689"]],[["999999961946176 63"],["999999961946176"]],[["1048576 12"],["2048"]],[["745 21"],["-1"]],[["748 6"],["22"]],[["999999961946176 50"],["161082468097"]],[["10 3"],["5"]],[["1099511627776 22"],["2097152"]],[["1000000007 100010"],["-1"]],[["3 1"],["1"]],[["100 8"],["50"]],[["100 7"],["25"]],[["7 2"],["7"]],[["999999961946176 64"],["-1"]],[["20 5"],["10"]],[["999999999999989 2"],["999999999999989"]],[["100000000000000 114"],["10240000"]],[["99999640000243 3"],["9999991"]],[["999998000001 566"],["333332666667"]],[["99999820000081 2"],["9999991"]],[["49000042000009 3"],["49000042000009"]],[["151491429961 4"],["-1"]],[["32416190071 2"],["32416190071"]],[["1000 8"],["25"]],[["1999967841 15"],["1999967841"]],[["26880 26880"],["-1"]],[["151491429961 3"],["151491429961"]],[["90000000000 300"],["100000000"]],[["98765004361 10"],["-1"]],[["15 2"],["3"]],[["16 2"],["2"]],[["1996 2"],["2"]],[["1997 2"],["1997"]],[["1999 2"],["1999"]],[["1998 2"],["2"]],[["1998 1"],["1"]],[["1998 7"],["27"]],[["1998 8"],["37"]],[["100000380000361 2"],["10000019"]],[["15 1"],["1"]],[["100000000000000 226"],["-1"]],[["844030857550613 517"],["-1"]],[["4567890 14"],["430"]],[["123123123 123123123"],["-1"]],[["24 4"],["4"]],[["999999993568952 17"],["31622777"]],[["99999999994190 9"],["241656799"]],[["999997874844049 4"],["-1"]],[["99999999999931 2"],["99999999999931"]],[["2 3"],["-1"]],[["67280421310721 2"],["67280421310721"]]]}} +{"instance_id":"pseudo_to_code_0.5k_101","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nfunction iamax (get pointer to int arr, int N, return int)\n ma=arr[0]\n for i=1 to N exclusive ma=max(arr[i], ma)\n return ma\nend of the block\nfunction readarr (get pointer to int arr and N, return nothing)\n read into N\n for i=0 to number pointed by N exclusive read arr[i]\nend of the block\narr=array of 1005 char\nk,n=int\nfunction pal (get int a and b, return bool)\n while a> *N;\n for (int i = 0; i < *N; i++) cin >> arr[i];\n}\nchar arr[1005];\nint k, n;\nbool pal(int a, int b) {\n while (a < b) {\n if (arr[a] != arr[b - 1]) return false;\n a++;\n b--;\n }\n return true;\n}\nbool run() {\n int mul = n \/ k;\n for (int i = 0; i < n; i += mul) {\n if (!pal(i, i + mul)) return false;\n }\n return true;\n}\nint main() {\n cin >> arr >> k;\n n = strlen(arr);\n if (n % k)\n cout << \"NO\\n\";\n else {\n if (run())\n cout << \"YES\\n\";\n else\n cout << \"NO\\n\";\n }\n}","item":{"problem_id":"548A","pseudocode":"function iamax (get pointer to int arr, int N, return int)\n ma=arr[0]\n for i=1 to N exclusive ma=max(arr[i], ma)\n return ma\nend of the block\nfunction readarr (get pointer to int arr and N, return nothing)\n read into N\n for i=0 to number pointed by N exclusive read arr[i]\nend of the block\narr=array of 1005 char\nk,n=int\nfunction pal (get int a and b, return bool)\n while a\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare long ints n and ans where ans = 0\n read n\n create integers vector v\n for i = 0 to n exclusive\n create integer x\n read x\n push x to v\n end of the block\n sort v\n for i from 0 to n - 1 exclusive, increase ans by v[n - 1] - v[i]\n print ans\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long int n, ans = 0;\n cin >> n;\n vector v;\n for (int i = 0; i < n; i++) {\n int x;\n cin >> x;\n v.push_back(x);\n }\n sort(v.begin(), v.end());\n for (int i = 0; i < n - 1; i++) { ans += v[n - 1] - v[i]; }\n cout << ans << endl;\n}","item":{"problem_id":"758A","pseudocode":"define the main function\n declare long ints n and ans where ans = 0\n read n\n create integers vector v\n for i = 0 to n exclusive\n create integer x\n read x\n push x to v\n end of the block\n sort v\n for i from 0 to n - 1 exclusive, increase ans by v[n - 1] - v[i]\n print ans\nend of the block","testcases":[[["5","0 1 2 3 4"],["10"]],[["5","1 1 0 1 1"],["1"]],[["3","1 3 1"],["4"]],[["1","12"],["0"]],[["3","1 2 3"],["3"]],[["14","52518 718438 358883 462189 853171 592966 225788 46977 814826 295697 676256 561479 56545 764281"],["5464380"]],[["21","842556 216391 427181 626688 775504 168309 851038 448402 880826 73697 593338 519033 135115 20128 424606 939484 846242 756907 377058 241543 29353"],["9535765"]],[["3","1 3 2"],["3"]],[["3","2 1 3"],["3"]],[["3","2 3 1"],["3"]],[["3","3 1 2"],["3"]],[["3","3 2 1"],["3"]],[["1","228503"],["0"]],[["2","32576 550340"],["517764"]],[["3","910648 542843 537125"],["741328"]],[["4","751720 572344 569387 893618"],["787403"]],[["6","433864 631347 597596 794426 713555 231193"],["1364575"]],[["9","31078 645168 695751 126111 375934 150495 838412 434477 993107"],["4647430"]],[["30","315421 772664 560686 654312 151528 356749 351486 707462 820089 226682 546700 136028 824236 842130 578079 337807 665903 764100 617900 822937 992759 591749 651310 742085 767695 695442 17967 515106 81059 186025"],["13488674"]],[["45","908719 394261 815134 419990 926993 383792 772842 277695 527137 655356 684956 695716 273062 550324 106247 399133 442382 33076 462920 294674 846052 817752 421365 474141 290471 358990 109812 74492 543281 169434 919692 786809 24028 197184 310029 801476 699355 429672 51343 374128 776726 850380 293868 981569 550763"],["21993384"]],[["56","100728 972537 13846 385421 756708 184642 259487 319707 376662 221694 675284 972837 499419 13846 38267 289898 901299 831197 954715 197515 514102 910423 127555 883934 362472 870788 538802 741008 973434 448124 391526 363321 947321 544618 68006 782313 955075 741981 815027 723297 585059 718114 700739 413489 454091 736144 308999 98065 3716 347323 9635 289003 986510 607065 60236 273351"],["26984185"]],[["70","644488 5444 150441 714420 602059 335330 510670 196555 546346 740011 509449 850947 692874 524857 750434 952985 223744 374727 896124 753037 367352 679050 560202 172728 569291 778616 332116 286927 843598 372698 244906 498046 900681 709791 420904 724593 864493 813094 791377 39998 296710 625656 403891 579231 706693 984045 16901 574259 562265 761104 930361 256045 124461 538980 573508 372148 988722 108592 784354 55302 232524 277205 782251 299943 436488 743389 324618 742543 266915 99642"],["32816391"]],[["1","0"],["0"]],[["1","1000000"],["0"]],[["100","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 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 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 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"],["0"]],[["100","1000000 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 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"],["99000000"]],[["100","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 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000000"],["99000000"]],[["100","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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000000 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 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 0"],["99000000"]],[["3","0 0 0"],["0"]],[["50","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"],["0"]],[["3","5 0 0"],["10"]],[["5","2 10 0 0 0"],["38"]]]}} +{"instance_id":"pseudo_to_code_0.5k_103","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate constant long long MAX = 1000\ndefine the main function\n declare long long variable n\n read input to n\n if n is odd\n print 1\n else\n print 2 to the output\nend of the block\n\n[CODE]:","reference_output":"const long long MAX = 1000;\nint main() {\n long long n;\n cin >> n;\n if (n % 2 == 1)\n cout << 1 << endl;\n else\n cout << 2 << endl;\n}","item":{"problem_id":"630R","pseudocode":"create constant long long MAX = 1000\ndefine the main function\n declare long long variable n\n read input to n\n if n is odd\n print 1\n else\n print 2 to the output\nend of the block","testcases":[[["1"],["1"]],[["2"],["2"]],[["3"],["1"]],[["4"],["2"]],[["5"],["1"]],[["1000000000000000000"],["2"]],[["999999999999999999"],["1"]],[["321392715309062180"],["2"]],[["95451113283177888"],["2"]],[["25496382240130775"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_104","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n a, b, c = long long\n read a, b, c\n ada = boolean = 0\n for i = 0, i is multiplied by a to 100000 inclusive\n for i = 0, i is multiplied by b to 100000 inclusive\n if j * b + i * a > c, exit the for loop\n if j * b + i * a is c, ada = 1\n if ada is nonzero, exit the loop\n end of the block\n if ada is nonzero, exit the loop\n end of the block\n if ada is nonzero\n print Yes\n else\n print No\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long a, b, c;\n cin >> a >> b >> c;\n bool ada = 0;\n for (long long i = 0; i * a <= 100000; i++) {\n for (long long j = 0; j * b <= 100000; j++) {\n if (j * b + i * a > c) break;\n if (j * b + i * a == c) ada = 1;\n if (ada) break;\n }\n if (ada) break;\n }\n if (ada)\n cout << \"Yes\" << endl;\n else\n cout << \"No\" << endl;\n}","item":{"problem_id":"633A","pseudocode":"define the main function\n a, b, c = long long\n read a, b, c\n ada = boolean = 0\n for i = 0, i is multiplied by a to 100000 inclusive\n for i = 0, i is multiplied by b to 100000 inclusive\n if j * b + i * a > c, exit the for loop\n if j * b + i * a is c, ada = 1\n if ada is nonzero, exit the loop\n end of the block\n if ada is nonzero, exit the loop\n end of the block\n if ada is nonzero\n print Yes\n else\n print No\nend of the block","testcases":[[["4 6 15"],["No"]],[["3 2 7"],["Yes"]],[["6 11 6"],["Yes"]],[["3 12 15"],["Yes"]],[["5 5 10"],["Yes"]],[["6 6 7"],["No"]],[["1 1 20"],["Yes"]],[["12 14 19"],["No"]],[["15 12 26"],["No"]],[["2 4 8"],["Yes"]],[["4 5 30"],["Yes"]],[["4 5 48"],["Yes"]],[["2 17 105"],["Yes"]],[["10 25 282"],["No"]],[["6 34 323"],["No"]],[["2 47 464"],["Yes"]],[["4 53 113"],["Yes"]],[["6 64 546"],["Yes"]],[["1 78 725"],["Yes"]],[["1 84 811"],["Yes"]],[["3 100 441"],["Yes"]],[["20 5 57"],["No"]],[["14 19 143"],["No"]],[["17 23 248"],["No"]],[["11 34 383"],["Yes"]],[["20 47 568"],["Yes"]],[["16 58 410"],["Yes"]],[["11 70 1199"],["Yes"]],[["16 78 712"],["Yes"]],[["20 84 562"],["No"]],[["19 100 836"],["Yes"]],[["23 10 58"],["No"]],[["25 17 448"],["Yes"]],[["22 24 866"],["Yes"]],[["24 35 67"],["No"]],[["29 47 264"],["Yes"]],[["23 56 45"],["No"]],[["25 66 1183"],["Yes"]],[["21 71 657"],["Yes"]],[["29 81 629"],["No"]],[["23 95 2226"],["Yes"]],[["32 4 62"],["No"]],[["37 15 789"],["Yes"]],[["39 24 999"],["Yes"]],[["38 32 865"],["No"]],[["32 50 205"],["No"]],[["31 57 1362"],["Yes"]],[["38 68 1870"],["Yes"]],[["36 76 549"],["No"]],[["35 84 1257"],["No"]],[["39 92 2753"],["Yes"]],[["44 1 287"],["Yes"]],[["42 12 830"],["No"]],[["42 27 9"],["No"]],[["49 40 1422"],["No"]],[["44 42 2005"],["No"]],[["50 55 2479"],["No"]],[["48 65 917"],["No"]],[["45 78 152"],["No"]],[["43 90 4096"],["Yes"]],[["43 94 4316"],["Yes"]],[["60 7 526"],["Yes"]],[["53 11 735"],["Yes"]],[["52 27 609"],["Yes"]],[["57 32 992"],["Yes"]],[["52 49 421"],["No"]],[["57 52 2634"],["Yes"]],[["54 67 3181"],["Yes"]],[["52 73 638"],["No"]],[["57 84 3470"],["No"]],[["52 100 5582"],["No"]],[["62 1 501"],["Yes"]],[["63 17 858"],["Yes"]],[["70 24 1784"],["Yes"]],[["65 32 1391"],["Yes"]],[["62 50 2775"],["No"]],[["62 58 88"],["No"]],[["66 68 3112"],["Yes"]],[["61 71 1643"],["No"]],[["69 81 3880"],["No"]],[["63 100 1960"],["Yes"]],[["73 6 431"],["Yes"]],[["75 19 736"],["Yes"]],[["78 25 247"],["No"]],[["79 36 2854"],["Yes"]],[["80 43 1864"],["Yes"]],[["76 55 2196"],["Yes"]],[["76 69 4122"],["Yes"]],[["76 76 4905"],["No"]],[["75 89 3056"],["Yes"]],[["73 100 3111"],["Yes"]],[["84 9 530"],["No"]],[["82 18 633"],["No"]],[["85 29 2533"],["Yes"]],[["89 38 2879"],["Yes"]],[["89 49 2200"],["Yes"]],[["88 60 4140"],["Yes"]],[["82 68 1299"],["No"]],[["90 76 2207"],["No"]],[["83 84 4923"],["Yes"]],[["89 99 7969"],["Yes"]],[["94 9 168"],["No"]],[["91 20 1009"],["No"]],[["93 23 2872"],["Yes"]],[["97 31 3761"],["Yes"]],[["99 46 1341"],["Yes"]],[["98 51 2845"],["No"]],[["93 66 3412"],["No"]],[["95 76 3724"],["Yes"]],[["91 87 6237"],["Yes"]],[["98 97 7886"],["Yes"]],[["12 17 15"],["No"]],[["93 94 95"],["No"]],[["27 43 27"],["Yes"]],[["17 43 68"],["Yes"]],[["44 12 12"],["Yes"]],[["44 50 150"],["Yes"]],[["1 1 10000"],["Yes"]],[["2 3 10000"],["Yes"]],[["100 1 10"],["Yes"]],[["3 2 1"],["No"]],[["1 1 1"],["Yes"]],[["9 9 10000"],["No"]],[["2 3 9995"],["Yes"]],[["3 5 4"],["No"]],[["99 98 100"],["No"]],[["6 10 2"],["No"]],[["1 6 5"],["Yes"]],[["1 4 3"],["Yes"]],[["3 2 3"],["Yes"]],[["1 7 6"],["Yes"]],[["2 3 9871"],["Yes"]],[["10 5 5"],["Yes"]],[["10 8 2"],["No"]]]}} +{"instance_id":"pseudo_to_code_0.5k_105","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\na = integer array of size 105\nin function summ with parameters integers l, r and return long long\n ans = long long set to 0\n for i = l to r inclusive, add a[i] to ans\n return ans\nend of the block\ndefine the main function\n declare an integer n\n input n\n sum = long long set to 0\n ans = integer set to 0\n for i = 1 to n inclusive\n read a[i]\n add a[i] to sum\n if a[i] is 0, increment ans\n end of the block\n if sum is 0\n if ans is n\n print NO\n else\n for i = 1 to n exclusive\n if call summ with 1, i isn't 0 and call summ with i + 1, n isn't 0\n print YES, newline, 2\n print 1, \" \", i\n print i + 1, \" \", n\n break\n end of the block\n end of the block\n end of the block\n else\n print YES\n print 1\n print 1, \" \", n\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int a[105];\nlong long summ(int l, int r) {\n long long ans = 0;\n for (int i = l; i <= r; i++) { ans += a[i]; }\n return ans;\n}\nint main() {\n int n;\n cin >> n;\n long long sum = 0;\n int ans = 0;\n for (int i = 1; i <= n; i++) {\n cin >> a[i];\n sum += a[i];\n if (a[i] == 0) ans++;\n }\n if (sum == 0) {\n if (ans == n) {\n cout << \"NO\" << endl;\n } else {\n for (int i = 1; i < n; i++) {\n if (summ(1, i) != 0 && summ(i + 1, n) != 0) {\n cout << \"YES\" << endl << 2 << endl;\n cout << 1 << \" \" << i << endl;\n cout << i + 1 << \" \" << n << endl;\n break;\n }\n }\n }\n } else {\n cout << \"YES\" << endl;\n cout << 1 << endl;\n cout << 1 << \" \" << n << endl;\n }\n return 0;\n}","item":{"problem_id":"754A","pseudocode":"a = integer array of size 105\nin function summ with parameters integers l, r and return long long\n ans = long long set to 0\n for i = l to r inclusive, add a[i] to ans\n return ans\nend of the block\ndefine the main function\n declare an integer n\n input n\n sum = long long set to 0\n ans = integer set to 0\n for i = 1 to n inclusive\n read a[i]\n add a[i] to sum\n if a[i] is 0, increment ans\n end of the block\n if sum is 0\n if ans is n\n print NO\n else\n for i = 1 to n exclusive\n if call summ with 1, i isn't 0 and call summ with i + 1, n isn't 0\n print YES, newline, 2\n print 1, \" \", i\n print i + 1, \" \", n\n break\n end of the block\n end of the block\n end of the block\n else\n print YES\n print 1\n print 1, \" \", n\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["3","1 2 -3"],["YES","2","1 1","2 3"]],[["8","9 -12 3 4 -4 -10 7 3"],["YES","2","1 1","2 8"]],[["1","0"],["NO"]],[["4","1 2 3 -5"],["YES","1","1 4"]],[["6","0 0 0 0 0 0"],["NO"]],[["100","507 -724 -243 -846 697 -569 -786 472 756 -272 731 -534 -664 202 592 -381 161 -668 -895 296 472 -868 599 396 -617 310 -283 -118 829 -218 807 939 -152 -343 -96 692 -570 110 442 159 -446 -631 -881 784 894 -3 -792 654 -273 -791 638 -599 -763 586 -812 248 -590 455 926 -402 61 228 209 419 -511 310 -283 857 369 472 -82 -435 -717 -421 862 -384 659 -235 406 793 -167 -504 -432 -951 0 165 36 650 -145 -500 988 -513 -495 -476 312 -754 332 819 -797 -715"],["YES","1","1 100"]],[["100","1 -2 -1 -1 2 2 0 1 -1 1 0 -2 1 -1 0 -2 -1 -1 2 0 -1 2 0 1 -2 -2 -1 1 2 0 -2 -2 -1 1 1 -1 -2 -1 0 -1 2 1 -1 -2 0 2 1 1 -2 1 1 -1 2 -2 2 0 1 -1 1 -2 0 0 0 0 0 0 -2 -2 2 1 2 2 0 -1 1 1 -2 -2 -2 1 0 2 -1 -2 -1 0 0 0 2 1 -2 0 -2 0 2 1 -2 -1 2 1"],["YES","1","1 100"]],[["7","0 0 0 0 3 -3 0"],["YES","2","1 5","6 7"]],[["5","0 0 -4 0 0"],["YES","1","1 5"]],[["100","2 -38 51 -71 -24 19 35 -27 48 18 64 -4 30 -28 74 -17 -19 -25 54 41 3 -46 -43 -42 87 -76 -62 28 1 32 7 -76 15 0 -82 -33 17 40 -41 -7 43 -18 -27 65 -27 -13 46 -38 75 7 62 -23 7 -12 80 36 37 14 6 -40 -11 -35 -77 -24 -59 75 -41 -21 17 -21 -14 67 -36 16 -1 34 -26 30 -62 -4 -63 15 -49 18 57 7 77 23 -26 8 -20 8 -16 9 50 -24 -33 9 -9 -33"],["YES","2","1 1","2 100"]],[["100","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 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 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 0 0 0 0 0 0 -38 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"],["YES","1","1 100"]],[["100","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 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 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 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"],["NO"]],[["100","0 0 -17 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 0 0 0 0 0 0 17 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"],["YES","2","1 3","4 100"]],[["3","1 -3 3"],["YES","1","1 3"]],[["3","1 0 -1"],["YES","2","1 1","2 3"]],[["3","3 0 0"],["YES","1","1 3"]],[["3","0 0 0"],["NO"]],[["3","-3 3 0"],["YES","2","1 1","2 3"]],[["4","3 -2 -1 3"],["YES","1","1 4"]],[["4","-1 0 1 0"],["YES","2","1 1","2 4"]],[["4","0 0 0 3"],["YES","1","1 4"]],[["4","0 0 0 0"],["NO"]],[["4","3 0 -3 0"],["YES","2","1 1","2 4"]],[["5","-3 2 2 0 -2"],["YES","1","1 5"]],[["5","0 -1 2 0 -1"],["YES","2","1 2","3 5"]],[["5","0 2 0 0 0"],["YES","1","1 5"]],[["5","0 0 0 0 0"],["NO"]],[["5","0 0 0 0 0"],["NO"]],[["20","101 89 -166 -148 -38 -135 -138 193 14 -134 -185 -171 -52 -191 195 39 -148 200 51 -73"],["YES","1","1 20"]],[["20","-118 -5 101 7 9 144 55 -55 -9 -126 -71 -71 189 -64 -187 123 0 -48 -12 138"],["YES","2","1 1","2 20"]],[["20","-161 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"],["YES","1","1 20"]],[["20","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"],["NO"]],[["20","0 0 0 0 0 0 0 0 0 0 0 0 0 0 -137 0 0 0 0 137"],["YES","2","1 15","16 20"]],[["40","64 -94 -386 -78 35 -233 33 82 -5 -200 368 -259 124 353 390 -305 -247 -133 379 44 133 -146 151 -217 -16 53 -157 186 -203 -8 117 -71 272 -290 -97 133 52 113 -280 -176"],["YES","1","1 40"]],[["40","120 -96 -216 131 231 -80 -166 -102 16 227 -120 105 43 -83 -53 229 24 190 -268 119 230 348 -33 19 0 -187 -349 -25 80 -38 -30 138 -104 337 -98 0 1 -66 -243 -231"],["YES","2","1 1","2 40"]],[["40","0 0 0 0 0 0 324 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 0 0 0 0 0 0 0 0"],["YES","1","1 40"]],[["40","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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"],["NO"]],[["40","0 0 0 0 0 308 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 0 -308 0 0 0 0 0 0 0"],["YES","2","1 6","7 40"]],[["60","-288 -213 -213 -23 496 489 137 -301 -219 -296 -577 269 -153 -52 -505 -138 -377 500 -256 405 588 274 -115 375 -93 117 -360 -160 429 -339 502 310 502 572 -41 -26 152 -203 562 -525 -179 -67 424 62 -329 -127 352 -474 417 -30 518 326 200 -598 471 107 339 107 -9 -244"],["YES","1","1 60"]],[["60","112 141 -146 -389 175 399 -59 327 -41 397 263 -422 157 0 471 -2 -381 -438 99 368 173 9 -171 118 24 111 120 70 11 317 -71 -574 -139 0 -477 -211 -116 -367 16 568 -75 -430 75 -179 -21 156 291 -422 441 -224 -8 -337 -104 381 60 -138 257 91 103 -359"],["YES","2","1 1","2 60"]],[["60","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 0 0 0 0 0 0 -238 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 0 0 0"],["YES","1","1 60"]],[["60","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 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 0 0 0 0 0 0 0 0 0 0"],["NO"]],[["60","0 0 0 0 0 0 0 0 0 -98 0 0 0 0 0 0 0 0 98 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"],["YES","2","1 10","11 60"]],[["80","-295 -774 -700 -366 -304 -173 -672 288 -721 -256 -348 650 223 211 379 -13 -483 162 800 631 -550 -704 -357 -306 490 713 -80 -234 -669 675 -688 471 315 607 -87 -327 -799 514 248 379 271 325 -244 98 -100 -447 574 -154 554 -377 380 -423 -140 -147 -189 -420 405 464 -110 273 -226 -109 -578 641 -426 -548 214 -184 -397 570 -428 -676 652 -155 127 462 338 534 -782 -481"],["YES","1","1 80"]],[["80","237 66 409 -208 -460 4 -448 29 -420 -192 -21 -76 -147 435 205 -42 -299 -29 244 -480 -4 -38 2 -214 -311 556 692 111 -19 -84 -90 -350 -354 125 -207 -137 93 367 -481 -462 -440 -92 424 -107 221 -100 -631 -72 105 201 226 -90 197 -264 427 113 202 -144 -115 398 331 147 56 -24 292 -267 -31 -11 202 506 334 -103 534 -155 -472 -124 -257 209 12 360"],["YES","2","1 1","2 80"]],[["80","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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 668 0 0 0 0 0 0 0 0 0 0 0 0 0 0"],["YES","1","1 80"]],[["80","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 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 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 0 0 0 0 0"],["NO"]],[["80","0 0 0 0 0 0 0 0 0 0 0 0 -137 137 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"],["YES","2","1 13","14 80"]],[["100","-98 369 544 197 -991 231 399 521 582 -820 -650 -919 -615 -411 -843 -974 231 140 239 -209 721 84 -834 -27 162 460 -157 -40 0 -778 -491 -607 -34 -647 834 -7 -518 -5 -31 -766 -54 -698 -838 497 980 -77 238 549 -135 7 -629 -892 455 181 527 314 465 -321 656 -390 368 384 601 332 561 -1000 -636 -106 412 -216 -58 -365 -155 -445 404 114 260 -392 -20 840 -395 620 -860 -936 1 882 958 536 589 235 300 676 478 434 229 698 157 -95 908 -170"],["YES","1","1 100"]],[["100","-149 -71 -300 288 -677 -580 248 49 -167 264 -215 878 7 252 -239 25 -369 -22 526 -415 -175 173 549 679 161 -411 743 -454 -34 -714 282 -198 -47 -519 -45 71 615 -214 -317 399 86 -97 246 689 -22 -197 -139 237 -501 477 -385 -421 -463 -641 409 -279 538 -382 48 189 652 -696 74 303 6 -183 336 17 -178 -617 -739 280 -202 454 864 218 480 293 -118 -518 -24 -866 -357 410 239 -833 510 316 -168 38 -370 -22 741 470 -60 -507 -209 704 141 -148"],["YES","2","1 1","2 100"]],[["100","0 0 697 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 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"],["YES","1","1 100"]],[["100","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 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 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 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"],["NO"]],[["100","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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -475 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 475 0 0 0 0"],["YES","2","1 70","71 100"]],[["4","0 0 3 -3"],["YES","2","1 3","4 4"]],[["4","1 0 0 0"],["YES","1","1 4"]],[["4","3 3 3 3"],["YES","1","1 4"]],[["2","0 1"],["YES","1","1 2"]],[["4","0 -1 1 0"],["YES","2","1 2","3 4"]],[["1","1"],["YES","1","1 1"]],[["5","0 0 1 0 0"],["YES","1","1 5"]],[["4","0 0 1 0"],["YES","1","1 4"]],[["10","1 2 0 0 3 -3 0 0 -3 0"],["YES","2","1 1","2 10"]],[["3","0 -1 0"],["YES","1","1 3"]],[["2","1 0"],["YES","1","1 2"]],[["5","3 -3 0 0 0"],["YES","2","1 1","2 5"]],[["3","0 1 0"],["YES","1","1 3"]],[["4","0 0 0 1"],["YES","1","1 4"]],[["4","1 -1 1 -1"],["YES","2","1 1","2 4"]],[["1","-1"],["YES","1","1 1"]],[["2","1 1"],["YES","1","1 2"]],[["2","1 -1"],["YES","2","1 1","2 2"]],[["2","0 0"],["NO"]],[["2","0 -1"],["YES","1","1 2"]],[["2","-1 1"],["YES","2","1 1","2 2"]],[["2","-1 0"],["YES","1","1 2"]],[["2","-1 -1"],["YES","1","1 2"]],[["3","5 -5 5"],["YES","1","1 3"]],[["5","1 0 -1 0 1"],["YES","1","1 5"]],[["6","0 0 0 3 0 0"],["YES","1","1 6"]],[["3","1 -1 1"],["YES","1","1 3"]]]}} +{"instance_id":"pseudo_to_code_0.5k_106","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, m = integers\n read n and m\n i, x, y, t, up, down, ans, u_d, d_u, count, sum = integers with up set to 0, down set to 0, count set to 0, sum set to 0\n for 1 to n inclusive\n read x, y and t\n set up to 0\n set down to 0\n set count to 0\n set sum to 0\n set u_d to 2 * (m - x)\n set d_u to 2 * (x - 1)\n if x is equal to y\n print t\n else\n if t is less than or equal to x - 1\n if y is greater than x\n print x - 1 + y - x\n else\n print x - 1 + x - y + u_d\n end of the block\n else\n decrement t by x - 1\n set up to 1\n increment sum by x - 1\n while t is greater than 0\n if count % 2 is 0\n decrement t by u_d\n set down to 1\n set up to 1\n increment sum by u_d\n else\n decrement t by d_u\n set down to 0\n set up to 1\n increment sum by d_u\n end of the block\n increment count\n end of the block\n if y is greater than x\n if up is equal to 1\n print sum + y - x\n else\n print sum + d_u + y - x\n end of the block\n else\n if up is equal to 1\n print sum + x - y + u_d\n else\n print sum + x - y\n end of the block\n end of the block\n end of the block\n end of the block\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, m;\n cin >> n >> m;\n int i, x, y, t, up = 0, down = 0, ans, u_d, d_u, count = 0, sum = 0;\n for (i = 1; i <= n; i++) {\n cin >> x >> y >> t;\n up = 0;\n down = 0;\n count = 0;\n sum = 0;\n u_d = 2 * (m - x);\n d_u = 2 * (x - 1);\n if (x == y)\n cout << t << endl;\n else {\n if (t <= x - 1) {\n if (y > x) {\n cout << x - 1 + y - x << endl;\n } else {\n cout << x - 1 + x - y + u_d << endl;\n }\n } else {\n t -= (x - 1);\n up = 1;\n sum += (x - 1);\n while (t > 0) {\n if (count % 2 == 0) {\n t -= u_d;\n down = 1;\n up = 0;\n sum += u_d;\n } else {\n t -= d_u;\n down = 0;\n up = 1;\n sum += d_u;\n }\n count++;\n }\n if (y > x) {\n if (up == 1) {\n cout << sum + y - x << endl;\n } else {\n cout << sum + d_u + y - x << endl;\n }\n } else {\n if (up == 1) {\n cout << sum + x - y + u_d << endl;\n } else {\n cout << sum + x - y << endl;\n }\n }\n }\n }\n }\n}","item":{"problem_id":"117A","pseudocode":"define the main function\n n, m = integers\n read n and m\n i, x, y, t, up, down, ans, u_d, d_u, count, sum = integers with up set to 0, down set to 0, count set to 0, sum set to 0\n for 1 to n inclusive\n read x, y and t\n set up to 0\n set down to 0\n set count to 0\n set sum to 0\n set u_d to 2 * (m - x)\n set d_u to 2 * (x - 1)\n if x is equal to y\n print t\n else\n if t is less than or equal to x - 1\n if y is greater than x\n print x - 1 + y - x\n else\n print x - 1 + x - y + u_d\n end of the block\n else\n decrement t by x - 1\n set up to 1\n increment sum by x - 1\n while t is greater than 0\n if count % 2 is 0\n decrement t by u_d\n set down to 1\n set up to 1\n increment sum by u_d\n else\n decrement t by d_u\n set down to 0\n set up to 1\n increment sum by d_u\n end of the block\n increment count\n end of the block\n if y is greater than x\n if up is equal to 1\n print sum + y - x\n else\n print sum + d_u + y - x\n end of the block\n else\n if up is equal to 1\n print sum + x - y + u_d\n else\n print sum + x - y\n end of the block\n end of the block\n end of the block\n end of the block\n end of the block\nend of the block","testcases":[[["7 4","2 4 3","1 2 0","2 2 0","1 2 1","4 3 5","1 2 2","4 2 0"],["9","1","0","7","10","7","5"]],[["5 5","1 5 4","1 3 1","1 3 4","3 1 5","4 2 5"],["12","10","10","8","7"]],[["5 5","1 3 4","4 4 2","3 2 1","2 4 0","1 5 3"],["10","2","7","3","12"]],[["8 5","2 2 91","5 1 97","5 1 36","5 4 19","2 5 50","4 2 1","1 4 9","3 2 32"],["91","104","40","21","60","7","19","39"]],[["7 5","2 2 85","4 3 76","4 1 17","5 4 70","2 5 3","3 3 14","3 1 51"],["85","78","24","77","12","14","56"]],[["5 2","1 2 0","2 1 1","2 2 0","2 2 5","2 1 4"],["1","2","0","5","6"]],[["1 2","1 1 3"],["3"]],[["2 2","2 2 3","2 1 5"],["3","6"]],[["3 4","2 4 7","3 3 1","2 2 9"],["9","1","9"]],[["2 100000000","2 1 3","99999999 100000000 100000000"],["199999998","299999997"]]]}} +{"instance_id":"pseudo_to_code_0.5k_107","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n x = integer with x = 0\n s2 = string\n read s2\n for i = s2.length() - 2 down to 0\n if s2[i] is s2[i + 1], erase(i, 2) from s2\n end of the block\n print s2\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int x = 0;\n string s2;\n cin >> s2;\n for (int i = s2.length() - 2; i >= 0; i--) {\n if (s2[i] == s2[i + 1]) s2.erase(i, 2);\n }\n cout << s2 << endl;\n return 0;\n}","item":{"problem_id":"81A","pseudocode":"define the main function\n x = integer with x = 0\n s2 = string\n read s2\n for i = s2.length() - 2 down to 0\n if s2[i] is s2[i + 1], erase(i, 2) from s2\n end of the block\n print s2\n return to indicate successful execution\nend of the block","testcases":[[["hhoowaaaareyyoouu"],["wre"]],[["reallazy"],["rezy"]],[["abacabaabacabaa"],["a"]],[["xraccabccbry"],["xy"]],[["a"],["a"]],[["b"],["b"]],[["il"],["il"]],[["gfj"],["gfj"]],[["babbbbbababa"],["babababa"]],[["babbbbabbabbbababbabbbbbbabaabaababaaabbbbbabbbbaaaaabbaaabbaabaabbbbabbbababbabaaabbababaaababbbaaa"],["babababababababababababa"]],[["aab"],["b"]],[["abb"],["a"]],[["aba"],["aba"]],[["ab"],["ab"]]]}} +{"instance_id":"pseudo_to_code_0.5k_108","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare constant integer maxn = 1e5 + 10\ndeclare integer arrays a size maxn, b size maxn\ndeclare integer arrays c size maxn, d size maxn\ndefine the main function\n declare integer n\n read n\n for i = 0 to n exclusive\n read a[i]\n increment c[a[i]]\n end of the block\n for i = 0 to n exclusive\n read b[i]\n increment d[b[i]]\n end of the block\n declare integer k = 0\n for i = 1 to 5 inclusive\n if (d[i] + c[i] bitwise and 1 )\n print \"-1\" and newline\n return to indicate successful execution\n end of the block\n increment k by absolute value of ( c[i] - d[i] ) \/ 2\n end of the block\n print k \/ 2 and newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int maxn = 1e5 + 10;\nint a[maxn], b[maxn];\nint c[maxn], d[maxn];\nint main() {\n int n;\n cin >> n;\n for (int i = 0; i < n; i++) {\n cin >> a[i];\n c[a[i]]++;\n }\n for (int i = 0; i < n; i++) {\n cin >> b[i];\n d[b[i]]++;\n }\n int k = 0;\n for (int i = 1; i <= 5; i++) {\n if ((d[i] + c[i] & 1)) {\n cout << \"-1\" << endl;\n return 0;\n }\n k += abs(c[i] - d[i]) \/ 2;\n }\n cout << k \/ 2 << endl;\n return 0;\n}","item":{"problem_id":"779A","pseudocode":"declare constant integer maxn = 1e5 + 10\ndeclare integer arrays a size maxn, b size maxn\ndeclare integer arrays c size maxn, d size maxn\ndefine the main function\n declare integer n\n read n\n for i = 0 to n exclusive\n read a[i]\n increment c[a[i]]\n end of the block\n for i = 0 to n exclusive\n read b[i]\n increment d[b[i]]\n end of the block\n declare integer k = 0\n for i = 1 to 5 inclusive\n if (d[i] + c[i] bitwise and 1 )\n print \"-1\" and newline\n return to indicate successful execution\n end of the block\n increment k by absolute value of ( c[i] - d[i] ) \/ 2\n end of the block\n print k \/ 2 and newline\n return to indicate successful execution\nend of the block","testcases":[[["4","5 4 4 4","5 5 4 5"],["1"]],[["6","1 1 1 1 1 1","5 5 5 5 5 5"],["3"]],[["1","5","3"],["-1"]],[["9","3 2 5 5 2 3 3 3 2","4 1 4 1 1 2 4 4 1"],["4"]],[["1","1","2"],["-1"]],[["1","1","1"],["0"]],[["8","1 1 2 2 3 3 4 4","4 4 5 5 1 1 1 1"],["2"]],[["10","1 1 1 1 1 1 1 1 1 1","2 2 2 2 2 2 2 2 2 2"],["5"]],[["100","5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5","5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5"],["0"]],[["2","1 1","1 1"],["0"]],[["2","1 2","1 1"],["-1"]],[["2","2 2","1 1"],["1"]],[["2","1 2","2 1"],["0"]],[["2","1 1","2 2"],["1"]],[["5","5 5 5 5 5","5 5 5 5 5"],["0"]],[["5","5 5 5 3 5","5 3 5 5 5"],["0"]],[["5","2 3 2 3 3","2 3 2 2 2"],["1"]],[["5","4 4 1 4 2","1 2 4 2 2"],["1"]],[["50","4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4","4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4"],["0"]],[["50","1 3 1 3 3 3 1 3 3 3 3 1 1 1 3 3 3 1 3 1 1 1 3 1 3 1 3 3 3 1 3 1 1 3 3 3 1 1 1 1 3 3 1 1 1 3 3 1 1 1","1 3 1 3 3 1 1 3 1 3 3 1 1 1 1 3 3 1 3 1 1 3 1 1 3 1 1 1 1 3 3 1 3 3 3 3 1 3 3 3 3 3 1 1 3 3 1 1 3 1"],["0"]],[["50","1 1 1 4 1 1 4 1 4 1 1 4 1 1 4 1 1 4 1 1 4 1 4 4 4 1 1 4 1 4 4 4 4 4 4 4 1 4 1 1 1 1 4 1 4 4 1 1 1 4","1 4 4 1 1 4 1 4 4 1 1 4 1 4 1 1 4 1 1 1 4 4 1 1 4 1 4 1 1 4 4 4 4 1 1 4 4 1 1 1 4 1 4 1 4 1 1 1 4 4"],["0"]],[["50","3 5 1 3 3 4 3 4 2 5 2 1 2 2 5 5 4 5 4 2 1 3 4 2 3 3 3 2 4 3 5 5 5 5 5 5 2 5 2 2 5 4 4 1 5 3 4 2 1 3","3 5 3 2 5 3 4 4 5 2 3 4 4 4 2 2 4 4 4 3 3 5 5 4 3 1 4 4 5 5 4 1 2 5 5 4 1 2 3 4 5 5 3 2 3 4 3 5 1 1"],["3"]],[["100","5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5","5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5"],["0"]],[["100","1 1 3 1 3 1 1 3 1 1 3 1 3 1 1 3 3 3 3 3 3 3 3 3 3 3 3 1 3 3 1 1 1 3 1 1 1 3 1 1 3 3 1 3 3 1 3 1 3 3 3 3 1 1 3 3 3 1 1 3 1 3 3 3 1 3 3 3 3 3 1 3 3 3 3 1 3 1 3 3 3 3 3 3 3 3 1 3 3 3 3 3 3 3 1 1 3 1 1 1","1 1 1 3 3 3 3 3 3 3 1 3 3 3 1 3 3 3 3 3 3 1 3 3 1 3 3 1 1 1 3 3 3 3 3 3 3 1 1 3 3 3 1 1 3 3 1 1 1 3 3 3 1 1 3 1 1 3 3 1 1 3 3 3 3 3 3 1 3 3 3 1 1 3 3 3 1 1 3 3 1 3 1 3 3 1 1 3 3 1 1 3 1 3 3 3 1 3 1 3"],["0"]],[["100","2 4 5 2 5 5 4 4 5 4 4 5 2 5 5 4 5 2 5 2 2 4 5 4 4 4 2 4 2 2 4 2 4 2 2 2 4 5 5 5 4 2 4 5 4 4 2 5 4 2 5 4 5 4 5 4 5 5 5 4 2 2 4 5 2 5 5 2 5 2 4 4 4 5 5 2 2 2 4 4 2 2 2 5 5 2 2 4 5 4 2 4 4 2 5 2 4 4 4 4","4 4 2 5 2 2 4 2 5 2 5 4 4 5 2 4 5 4 5 2 2 2 2 5 4 5 2 4 2 2 5 2 5 2 4 5 5 5 2 5 4 4 4 4 5 2 2 4 2 4 2 4 5 5 5 4 5 4 5 5 5 2 5 4 4 4 4 4 2 5 5 4 2 4 4 5 5 2 4 4 4 2 2 2 5 4 2 2 4 5 4 4 4 4 2 2 4 5 5 2"],["0"]],[["100","3 3 4 3 3 4 3 1 4 2 1 3 1 1 2 4 4 4 4 1 1 4 1 4 4 1 1 2 3 3 3 2 4 2 3 3 3 1 3 4 2 2 1 3 4 4 3 2 2 2 4 2 1 2 1 2 2 1 1 4 2 1 3 2 4 4 4 2 3 1 3 1 3 2 2 2 2 4 4 1 3 1 1 4 2 3 3 4 4 2 4 4 2 4 3 3 1 3 2 4","3 1 4 4 2 1 1 1 1 1 1 3 1 1 3 4 3 2 2 4 2 1 4 4 4 4 1 2 3 4 2 3 3 4 3 3 2 4 2 2 2 1 2 4 4 4 2 1 3 4 3 3 4 2 4 4 3 2 4 2 4 2 4 4 1 4 3 1 4 3 3 3 3 1 2 2 2 2 4 1 2 1 3 4 3 1 3 3 4 2 3 3 2 1 3 4 2 1 1 2"],["0"]],[["100","2 4 5 2 1 5 5 2 1 5 1 5 1 1 1 3 4 5 1 1 2 3 3 1 5 5 4 4 4 1 1 1 5 2 3 5 1 2 2 1 1 1 2 2 1 2 4 4 5 1 3 2 5 3 5 5 3 2 2 2 1 3 4 4 4 4 4 5 3 1 4 1 5 4 4 5 4 5 2 4 4 3 1 2 1 4 5 3 3 3 3 2 2 2 3 5 3 1 3 4","3 2 5 1 5 4 4 3 5 5 5 2 1 4 4 3 2 3 3 5 5 4 5 5 2 1 2 4 4 3 5 1 1 5 1 3 2 5 2 4 4 2 4 2 4 2 3 2 5 1 4 4 1 1 1 5 3 5 1 1 4 5 1 1 2 2 5 3 5 1 1 1 2 3 3 2 3 2 4 4 5 4 2 1 3 4 1 1 2 4 1 5 3 1 2 1 3 4 1 3"],["0"]],[["100","5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5","5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5"],["0"]],[["100","1 4 4 1 4 4 1 1 4 1 1 1 1 4 4 4 4 1 1 1 1 1 1 4 4 4 1 1 4 4 1 1 1 1 4 4 4 4 4 1 1 4 4 1 1 1 4 1 1 1 1 4 4 4 4 4 4 1 4 4 4 4 1 1 1 4 1 4 1 1 1 1 4 1 1 1 4 4 4 1 4 4 1 4 4 4 4 4 1 4 1 1 4 1 4 1 1 1 4 4","4 1 1 4 4 4 1 4 4 4 1 1 4 1 1 4 1 4 4 4 1 1 4 1 4 1 1 1 4 4 1 4 1 4 1 4 4 1 1 4 1 4 1 1 1 4 1 4 4 4 1 4 1 4 4 4 4 1 4 1 1 4 1 1 4 4 4 1 4 1 4 1 4 4 4 1 1 4 1 4 4 4 4 1 1 1 1 1 4 4 1 4 1 4 1 1 1 4 4 1"],["1"]],[["100","5 2 5 2 2 3 3 2 5 3 2 5 3 3 3 5 2 2 5 5 3 3 5 3 2 2 2 3 2 2 2 2 3 5 3 3 2 3 2 5 3 3 5 3 2 2 5 5 5 5 5 2 3 2 2 2 2 3 2 5 2 2 2 3 5 5 5 3 2 2 2 3 5 3 2 5 5 3 5 5 5 3 2 5 2 3 5 3 2 5 5 3 5 2 3 3 2 2 2 2","5 3 5 3 3 5 2 5 3 2 3 3 5 2 5 2 2 5 2 5 2 5 3 3 5 3 2 2 2 3 5 3 2 2 3 2 2 5 5 2 3 2 3 3 5 3 2 5 2 2 2 3 3 5 3 3 5 2 2 2 3 3 2 2 3 5 3 5 5 3 3 2 5 3 5 2 3 2 5 5 3 2 5 5 2 2 2 2 3 2 2 5 2 5 2 2 3 3 2 5"],["1"]],[["100","4 4 5 4 3 5 5 2 4 5 5 5 3 4 4 2 5 2 5 3 3 3 3 5 3 2 2 2 4 4 4 4 3 3 4 5 3 2 2 2 4 4 5 3 4 5 4 5 5 2 4 2 5 2 3 4 4 5 2 2 4 4 5 5 5 3 5 4 5 5 5 4 3 3 2 4 3 5 5 5 2 4 2 5 4 3 5 3 2 3 5 2 5 2 2 5 4 5 4 3","5 4 2 4 3 5 2 5 5 3 4 5 4 5 3 3 5 5 2 3 4 2 3 5 2 2 2 4 2 5 2 4 4 5 2 2 4 4 5 5 2 3 4 2 4 5 2 5 2 2 4 5 5 3 5 5 5 4 3 4 4 3 5 5 3 4 5 3 2 3 4 3 4 4 2 5 3 4 5 5 3 5 3 3 4 3 5 3 2 2 4 5 4 5 5 2 3 4 3 5"],["1"]],[["100","1 4 2 2 2 1 4 5 5 5 4 4 5 5 1 3 2 1 4 5 2 3 4 4 5 4 4 4 4 5 1 3 5 5 3 3 3 3 5 1 4 3 5 1 2 4 1 3 5 5 1 3 3 3 1 3 5 4 4 2 2 5 5 5 2 3 2 5 1 3 5 4 5 3 2 2 3 2 3 3 2 5 2 4 2 3 4 1 3 1 3 1 5 1 5 2 3 5 4 5","1 2 5 3 2 3 4 2 5 1 2 5 3 4 3 3 4 1 5 5 1 3 3 1 1 4 1 4 2 5 4 1 3 4 5 3 2 2 1 4 5 5 2 3 3 5 5 4 2 3 3 5 3 3 5 4 4 5 3 5 1 1 4 4 4 1 3 5 5 5 4 2 4 5 3 2 2 2 5 5 5 1 4 3 1 3 1 2 2 4 5 1 3 2 4 5 1 5 2 5"],["1"]],[["100","3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3","3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3"],["0"]],[["100","5 2 2 2 5 2 5 5 5 2 5 2 5 5 5 5 5 5 2 2 2 5 5 2 5 2 2 5 2 5 5 2 5 2 5 2 5 5 5 5 5 2 2 2 2 5 5 2 5 5 5 2 5 5 5 2 5 5 5 2 2 2 5 2 2 2 5 5 2 5 5 5 2 5 2 2 5 2 2 2 5 5 5 5 2 5 2 5 2 2 5 2 5 2 2 2 2 5 5 2","5 5 2 2 5 5 2 5 2 2 5 5 5 5 2 5 5 2 5 2 2 5 2 2 5 2 5 2 2 5 2 5 2 5 5 2 2 5 5 5 2 5 5 2 5 5 5 2 2 5 5 5 2 5 5 5 2 2 2 5 5 5 2 2 5 5 2 2 2 5 2 5 5 2 5 2 5 2 2 5 5 2 2 5 5 2 2 5 2 2 5 2 2 2 5 5 2 2 2 5"],["1"]],[["100","3 3 2 2 1 2 3 3 2 2 1 1 3 3 1 1 1 2 1 2 3 2 3 3 3 1 2 3 1 2 1 2 3 3 2 1 1 1 1 1 2 2 3 2 1 1 3 3 1 3 3 1 3 1 3 3 3 2 1 2 3 1 3 2 2 2 2 2 2 3 1 3 1 2 2 1 2 3 2 3 3 1 2 1 1 3 1 1 1 2 1 2 2 2 3 2 3 2 1 1","1 3 1 2 1 1 1 1 1 2 1 2 1 3 2 2 3 2 1 1 2 2 2 1 1 3 2 3 2 1 2 2 3 2 3 1 3 1 1 2 3 1 2 1 3 2 1 2 3 2 3 3 3 2 2 2 3 1 3 1 1 2 1 3 1 3 1 3 3 3 1 3 3 2 1 3 3 3 3 3 2 1 2 2 3 3 2 1 2 2 1 3 3 1 3 2 2 1 1 3"],["1"]],[["100","5 3 3 2 5 3 2 4 2 3 3 5 3 4 5 4 3 3 4 3 2 3 3 4 5 4 2 4 2 4 5 3 3 4 5 3 5 3 5 3 3 2 5 3 4 5 2 5 2 2 4 2 2 2 2 5 4 5 4 3 5 4 2 5 5 3 4 5 2 3 2 2 2 5 3 2 2 2 3 3 5 2 3 2 4 5 3 3 3 5 2 3 3 3 5 4 5 5 5 2","4 4 4 5 5 3 5 5 4 3 5 4 3 4 3 3 5 3 5 5 3 3 3 5 5 4 4 3 2 5 4 3 3 4 5 3 5 2 4 2 2 2 5 3 5 2 5 5 3 3 2 3 3 4 2 5 2 5 2 4 2 4 2 3 3 4 2 2 2 4 4 3 3 3 4 3 3 3 5 5 3 4 2 2 3 5 5 2 3 4 5 4 5 3 4 2 5 3 2 4"],["3"]],[["100","5 3 4 4 2 5 1 1 4 4 3 5 5 1 4 4 2 5 3 2 1 1 3 2 4 4 4 2 5 2 2 3 1 4 1 4 4 5 3 5 1 4 1 4 1 5 5 3 5 5 1 5 3 5 1 3 3 4 5 3 2 2 4 5 2 5 4 2 4 4 1 1 4 2 4 1 2 2 4 3 4 1 1 1 4 3 5 1 2 1 4 5 4 4 2 1 4 1 3 2","1 1 1 1 4 2 1 4 1 1 3 5 4 3 5 2 2 4 2 2 4 1 3 4 4 5 1 1 2 2 2 1 4 1 4 4 1 5 5 2 3 5 1 5 4 2 3 2 2 5 4 1 1 4 5 2 4 5 4 4 3 3 2 4 3 4 5 5 4 2 4 2 1 2 3 2 2 5 5 3 1 3 4 3 4 4 5 3 1 1 3 5 1 4 4 2 2 1 4 5"],["2"]],[["100","3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3","3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3"],["0"]],[["100","3 3 4 3 3 4 3 3 4 4 3 3 3 4 3 4 3 4 4 3 3 3 3 3 3 4 3 3 4 3 3 3 3 4 3 3 3 4 4 4 3 3 4 4 4 3 4 4 3 3 4 3 3 3 4 4 4 3 4 3 3 3 3 3 3 3 4 4 3 3 3 3 4 3 3 3 3 3 4 4 3 3 3 3 3 4 3 4 4 4 4 3 4 3 4 4 4 4 3 3","4 3 3 3 3 4 4 3 4 4 4 3 3 4 4 3 4 4 4 4 3 4 3 3 3 4 4 4 3 4 3 4 4 3 3 4 3 3 3 3 3 4 3 3 3 3 4 4 4 3 3 4 3 4 4 4 4 3 4 4 3 3 4 3 3 4 3 4 3 4 4 4 4 3 3 4 3 4 4 4 3 3 4 4 4 4 4 3 3 3 4 3 3 4 3 3 3 3 3 3"],["5"]],[["100","4 2 5 2 5 4 2 5 5 4 4 2 4 4 2 4 4 5 2 5 5 2 2 4 4 5 4 5 5 5 2 2 2 2 4 4 5 2 4 4 4 2 2 5 5 4 5 4 4 2 4 5 4 2 4 5 4 2 4 5 4 4 4 4 4 5 4 2 5 2 5 5 5 5 4 2 5 5 4 4 2 5 2 5 2 5 4 2 4 2 4 5 2 5 2 4 2 4 2 4","5 4 5 4 5 2 2 4 5 2 5 5 5 5 5 4 4 4 4 5 4 5 5 2 4 4 4 4 5 2 4 4 5 5 2 5 2 5 5 4 4 5 2 5 2 5 2 5 4 5 2 5 2 5 2 4 4 5 4 2 5 5 4 2 2 2 5 4 2 2 4 4 4 5 5 2 5 2 2 4 4 4 2 5 4 5 2 2 5 4 4 5 5 4 5 5 4 5 2 5"],["5"]],[["100","3 4 5 3 5 4 5 4 4 4 2 4 5 4 3 2 3 4 3 5 2 5 2 5 4 3 4 2 5 2 5 3 4 5 2 5 4 2 4 5 4 3 2 4 4 5 2 5 5 3 3 5 2 4 4 2 3 3 2 5 5 5 2 4 5 5 4 2 2 5 3 3 2 4 4 2 4 5 5 2 5 5 3 2 5 2 4 4 3 3 5 4 5 5 2 5 4 5 4 3","4 3 5 5 2 4 2 4 5 5 5 2 3 3 3 3 5 5 5 5 3 5 2 3 5 2 3 2 2 5 5 3 5 3 4 2 2 5 3 3 3 3 5 2 4 5 3 5 3 4 4 4 5 5 3 4 4 2 2 4 4 5 3 2 4 5 5 4 5 2 2 3 5 4 5 5 2 5 4 3 2 3 2 5 4 5 3 4 5 5 3 5 2 2 4 4 3 2 5 2"],["4"]],[["100","4 1 1 2 1 4 4 1 4 5 5 5 2 2 1 3 5 2 1 5 2 1 2 4 4 2 1 2 2 2 4 3 1 4 2 2 3 1 1 4 4 5 4 4 4 5 1 4 1 4 3 1 2 1 2 4 1 2 5 2 1 4 3 4 1 4 2 1 1 1 5 3 3 1 4 1 3 1 4 1 1 2 2 2 3 1 4 3 4 4 5 2 5 4 3 3 3 2 2 1","5 1 4 4 3 4 4 5 2 3 3 4 4 2 3 2 3 1 3 1 1 4 1 5 4 3 2 4 3 3 3 2 3 4 1 5 4 2 4 2 2 2 5 3 1 2 5 3 2 2 1 1 2 2 3 5 1 2 5 3 2 1 1 2 1 2 4 3 5 4 5 3 2 4 1 3 4 1 4 4 5 4 4 5 4 2 5 3 4 1 4 2 4 2 4 5 4 5 4 2"],["6"]],[["100","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"],["0"]],[["100","3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3","3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3"],["0"]],[["100","4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 1 4 4 4 4 4 4 4 4 4 4","4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 1 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4"],["0"]],[["100","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2"],["1"]],[["100","3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3 3 3 3 3 3 1 3 3 3 3 3 3 3 4 3 3 3 3 3 3 3 3 3 3 1 3 1 3 3 3 3 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3","3 3 3 4 3 3 3 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 1 3 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3 3 3 3 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3 3 3 1 3 3 3 3 3 3 3 3 3 3"],["1"]],[["100","5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"],["50"]],[["100","3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5","3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1"],["25"]],[["100","3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5","2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4"],["50"]],[["100","1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5","5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5"],["40"]],[["100","1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5","2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3"],["30"]],[["5","4 4 4 4 5","4 5 5 5 5"],["-1"]],[["4","1 1 1 1","3 3 3 3"],["2"]],[["6","1 1 2 2 3 4","1 2 3 3 4 4"],["-1"]],[["4","1 1 1 2","3 3 3 3"],["-1"]],[["3","2 2 2","4 4 4"],["-1"]],[["2","1 2","3 4"],["-1"]],[["6","1 1 1 3 3 3","2 2 2 4 4 4"],["-1"]],[["5","1 2 2 2 2","1 1 1 1 3"],["-1"]],[["2","1 3","2 2"],["-1"]],[["2","1 3","4 5"],["-1"]],[["4","1 2 3 4","5 5 5 5"],["-1"]],[["2","1 3","2 4"],["-1"]],[["2","1 2","4 4"],["-1"]],[["2","1 2","3 3"],["-1"]],[["10","4 4 4 4 2 3 3 3 3 1","2 2 2 2 4 1 1 1 1 3"],["-1"]],[["6","1 2 3 3 4 4","1 1 2 2 3 4"],["-1"]],[["5","3 3 3 3 1","1 1 1 1 3"],["-1"]],[["2","1 1","2 3"],["-1"]],[["8","1 1 2 2 3 3 3 3","2 2 2 2 1 1 1 1"],["2"]],[["5","1 1 1 3 3","1 1 1 1 2"],["-1"]],[["6","2 2 3 3 4 4","2 3 4 5 5 5"],["-1"]],[["6","1 1 2 2 3 4","3 3 4 4 1 2"],["-1"]],[["4","1 2 3 3","3 3 3 3"],["-1"]],[["3","1 2 3","3 3 3"],["-1"]],[["5","3 3 3 2 2","2 2 2 3 3"],["-1"]],[["10","1 2 3 4 1 2 3 4 1 2","1 2 3 4 1 2 3 4 3 4"],["-1"]],[["2","2 2","1 3"],["-1"]],[["3","1 2 3","1 1 4"],["-1"]],[["4","3 4 4 4","3 3 4 4"],["-1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_109","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n a = integer\n read a\n if a & 1 or a = 2\n print \"NO\" and a new line\n else\n print \"YES\" and a new line\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int a;\n cin >> a;\n if (a & 1 || a == 2)\n cout << \"NO\" << endl;\n else\n cout << \"YES\" << endl;\n}","item":{"problem_id":"4A","pseudocode":"define the main function\n a = integer\n read a\n if a & 1 or a = 2\n print \"NO\" and a new line\n else\n print \"YES\" and a new line\nend of the block","testcases":[[["8"],["YES"]],[["5"],["NO"]],[["4"],["YES"]],[["3"],["NO"]],[["2"],["NO"]],[["1"],["NO"]],[["7"],["NO"]],[["6"],["YES"]],[["10"],["YES"]],[["9"],["NO"]],[["53"],["NO"]],[["77"],["NO"]],[["32"],["YES"]],[["44"],["YES"]],[["98"],["YES"]],[["99"],["NO"]],[["90"],["YES"]],[["67"],["NO"]],[["100"],["YES"]],[["88"],["YES"]]]}} +{"instance_id":"pseudo_to_code_0.5k_110","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n a, b, c, d are strings\n read a, b\n display a, ' ', b\n n is an integer\n read n\n iterate n times\n read c, d\n if c equals a\n assign d to a\n else\n assign d to b\n display a, ' ', b\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string a, b, c, d;\n cin >> a >> b;\n cout << a + ' ' + b << '\\n';\n int n;\n cin >> n;\n for (int i = 0; i < n; i++) {\n cin >> c >> d;\n if (c == a)\n a = d;\n else\n b = d;\n cout << a + ' ' + b << '\\n';\n }\n return 0;\n}","item":{"problem_id":"776A","pseudocode":"define the main function\n a, b, c, d are strings\n read a, b\n display a, ' ', b\n n is an integer\n read n\n iterate n times\n read c, d\n if c equals a\n assign d to a\n else\n assign d to b\n display a, ' ', b\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["ross rachel","4","ross joey","rachel phoebe","phoebe monica","monica chandler"],["ross rachel","joey rachel","joey phoebe","joey monica","joey chandler"]],[["icm codeforces","1","codeforces technex"],["icm codeforces","icm technex"]],[["a b","3","a c","b d","d e"],["a b","c b","c d","c e"]],[["ze udggmyop","4","ze szhrbmft","udggmyop mjorab","szhrbmft ojdtfnzxj","ojdtfnzxj yjlkg"],["ze udggmyop","szhrbmft udggmyop","szhrbmft mjorab","ojdtfnzxj mjorab","yjlkg mjorab"]],[["q s","10","q b","b j","s g","j f","f m","g c","c a","m d","d z","z o"],["q s","b s","j s","j g","f g","m g","m c","m a","d a","z a","o a"]],[["iii iiiiii","7","iii iiiiiiiiii","iiiiiiiiii iiii","iiii i","iiiiii iiiiiiii","iiiiiiii iiiiiiiii","i iiiii","iiiii ii"],["iii iiiiii","iiiiiiiiii iiiiii","iiii iiiiii","i iiiiii","i iiiiiiii","i iiiiiiiii","iiiii iiiiiiiii","ii iiiiiiiii"]],[["bwyplnjn zkms","26","zkms nzmcsytxh","nzmcsytxh yujsb","bwyplnjn gtbzhudpb","gtbzhudpb hpk","yujsb xvy","hpk wrwnfokml","wrwnfokml ndouuikw","ndouuikw ucgrja","ucgrja tgfmpldz","xvy nycrfphn","nycrfphn quvs","quvs htdy","htdy k","tgfmpldz xtdpkxm","xtdpkxm suwqxs","k fv","suwqxs qckllwy","qckllwy diun","fv lefa","lefa gdoqjysx","diun dhpz","gdoqjysx bdmqdyt","dhpz dgz","dgz v","bdmqdyt aswy","aswy ydkayhlrnm"],["bwyplnjn zkms","bwyplnjn nzmcsytxh","bwyplnjn yujsb","gtbzhudpb yujsb","hpk yujsb","hpk xvy","wrwnfokml xvy","ndouuikw xvy","ucgrja xvy","tgfmpldz xvy","tgfmpldz nycrfphn","tgfmpldz quvs","tgfmpldz htdy","tgfmpldz k","xtdpkxm k","suwqxs k","suwqxs fv","qckllwy fv","diun fv","diun lefa","diun gdoqjysx","dhpz gdoqjysx","dhpz bdmqdyt","dgz bdmqdyt","v bdmqdyt","v aswy","v ydkayhlrnm"]],[["wxz hbeqwqp","7","hbeqwqp cpieghnszh","cpieghnszh tlqrpd","tlqrpd ttwrtio","ttwrtio xapvds","xapvds zk","wxz yryk","zk b"],["wxz hbeqwqp","wxz cpieghnszh","wxz tlqrpd","wxz ttwrtio","wxz xapvds","wxz zk","yryk zk","yryk b"]],[["wced gnsgv","23","gnsgv japawpaf","japawpaf nnvpeu","nnvpeu a","a ddupputljq","ddupputljq qyhnvbh","qyhnvbh pqwijl","wced khuvs","khuvs bjkh","pqwijl ysacmboc","bjkh srf","srf jknoz","jknoz hodf","ysacmboc xqtkoyh","hodf rfp","xqtkoyh bivgnwqvoe","bivgnwqvoe nknf","nknf wuig","rfp e","e bqqknq","wuig sznhhhu","bqqknq dhrtdld","dhrtdld n","sznhhhu bguylf"],["wced gnsgv","wced japawpaf","wced nnvpeu","wced a","wced ddupputljq","wced qyhnvbh","wced pqwijl","khuvs pqwijl","bjkh pqwijl","bjkh ysacmboc","srf ysacmboc","jknoz ysacmboc","hodf ysacmboc","hodf xqtkoyh","rfp xqtkoyh","rfp bivgnwqvoe","rfp nknf","rfp wuig","e wuig","bqqknq wuig","bqqknq sznhhhu","dhrtdld sznhhhu","n sznhhhu","n bguylf"]],[["qqqqqqqqqq qqqqqqqq","3","qqqqqqqq qqqqqqqqq","qqqqqqqqq qqqqq","qqqqq q"],["qqqqqqqqqq qqqqqqqq","qqqqqqqqqq qqqqqqqqq","qqqqqqqqqq qqqqq","qqqqqqqqqq q"]],[["wwwww w","8","wwwww wwwwwwww","wwwwwwww wwwwwwwww","wwwwwwwww wwwwwwwwww","w www","wwwwwwwwww wwww","wwww ww","www wwwwww","wwwwww wwwwwww"],["wwwww w","wwwwwwww w","wwwwwwwww w","wwwwwwwwww w","wwwwwwwwww www","wwww www","ww www","ww wwwwww","ww wwwwwww"]],[["k d","17","k l","d v","v z","l r","z i","r s","s p","p w","w j","j h","i c","h m","m q","c o","o g","q x","x n"],["k d","l d","l v","l z","r z","r i","s i","p i","w i","j i","h i","h c","m c","q c","q o","q g","x g","n g"]]]}} +{"instance_id":"pseudo_to_code_0.5k_111","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integer n\n read n\n if n equal 0\n print 0\n else if n equal 2\n print 2\n else\n print 1\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n if (n == 0)\n cout << 0 << endl;\n else if (n == 2)\n cout << 2 << endl;\n else\n cout << 1 << endl;\n return 0;\n}","item":{"problem_id":"1081A","pseudocode":"define the main function\n declare integer n\n read n\n if n equal 0\n print 0\n else if n equal 2\n print 2\n else\n print 1\n return to indicate successful execution\nend of the block","testcases":[[["8"],["1"]],[["1"],["1"]],[["4"],["1"]],[["3"],["1"]],[["158260522"],["1"]],[["2"],["2"]],[["1000000000"],["1"]],[["5"],["1"]],[["7"],["1"]],[["9"],["1"]],[["10"],["1"]],[["11"],["1"]],[["12"],["1"]],[["13"],["1"]],[["641009859"],["1"]],[["802593587"],["1"]],[["819819"],["1"]],[["524125987"],["1"]],[["959461493"],["1"]],[["33313246"],["1"]],[["702209411"],["1"]],[["496813081"],["1"]],[["387883951"],["1"]],[["585325539"],["1"]],[["29599937"],["1"]],[["61142510"],["1"]],[["58376259"],["1"]],[["865222469"],["1"]],[["98120883"],["1"]],[["941492387"],["1"]],[["585501313"],["1"]],[["194574601"],["1"]],[["824608515"],["1"]],[["940751563"],["1"]],[["85054"],["1"]],[["2691939"],["1"]],[["539624191"],["1"]],[["896685075"],["1"]],[["802030518"],["1"]],[["640274071"],["1"]],[["577533"],["1"]],[["685146646"],["1"]],[["661597501"],["1"]],[["5920039"],["1"]],[["6"],["1"]],[["7"],["1"]],[["83"],["1"]],[["9"],["1"]],[["999999999"],["1"]],[["22"],["1"]],[["11111"],["1"]],[["666"],["1"]],[["10000000"],["1"]],[["11"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_112","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, one, two and trone are integers where one, two and trone = 0\n declare vector of ints called x\n read n\n for integer i = 0 to n exclusive\n declare integer variable tmp\n read tmp\n if tmp = 1\n increment one by 1\n else\n increment two by 1\n push tmp into x\n end of the block\n assign one to trone\n create int ans = min of one and two\n subtract ans from trone\n divide trone by 3\n print ans + trone\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, one = 0, two = 0, trone = 0;\n vector x;\n cin >> n;\n for (int i = 0; i < n; i++) {\n int tmp;\n cin >> tmp;\n if (tmp == 1)\n one++;\n else\n two++;\n x.push_back(tmp);\n }\n trone = one;\n int ans = min(one, two);\n trone -= ans;\n trone \/= 3;\n cout << ans + trone << endl;\n return 0;\n}","item":{"problem_id":"899A","pseudocode":"define the main function\n n, one, two and trone are integers where one, two and trone = 0\n declare vector of ints called x\n read n\n for integer i = 0 to n exclusive\n declare integer variable tmp\n read tmp\n if tmp = 1\n increment one by 1\n else\n increment two by 1\n push tmp into x\n end of the block\n assign one to trone\n create int ans = min of one and two\n subtract ans from trone\n divide trone by 3\n print ans + trone\n return to indicate successful execution\nend of the block","testcases":[[["4","1 1 2 1"],["1"]],[["2","2 2"],["0"]],[["7","2 2 2 1 1 1 1"],["3"]],[["3","1 1 1"],["1"]],[["3","2 2 2"],["0"]],[["3","1 2 1"],["1"]],[["5","2 2 1 1 1"],["2"]],[["7","1 1 2 2 1 2 1"],["3"]],[["10","1 2 2 1 2 2 1 2 1 1"],["5"]],[["5","2 2 2 1 2"],["1"]],[["43","1 2 2 2 1 1 2 2 1 1 2 2 2 2 1 2 2 2 2 2 1 2 1 2 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2"],["10"]],[["72","1 2 1 2 2 1 2 1 1 1 1 2 2 1 2 1 2 1 2 2 2 2 1 2 2 2 2 1 2 1 1 2 2 1 1 2 2 2 2 2 1 1 1 1 2 2 1 1 2 1 1 1 1 2 2 1 2 2 1 2 1 1 2 1 2 2 1 1 1 2 2 2"],["34"]],[["64","2 2 1 1 1 2 1 1 1 2 2 1 2 2 2 1 2 2 2 1 1 1 1 2 1 2 1 2 1 1 2 2 1 1 2 2 1 1 1 1 2 2 1 1 1 2 1 2 2 2 2 2 2 2 1 1 2 1 1 1 2 2 1 2"],["32"]],[["20","1 1 1 1 2 1 2 2 2 1 2 1 2 1 2 1 1 2 1 2"],["9"]],[["23","1 1 1 1 2 1 2 1 1 1 2 2 2 2 2 2 1 2 1 2 2 1 1"],["11"]],[["201","1 1 2 2 2 2 1 1 1 2 2 1 2 1 2 1 2 2 2 1 1 2 1 1 1 2 1 2 1 1 1 2 1 1 2 1 2 2 1 1 1 1 2 1 1 2 1 1 1 2 2 2 2 1 2 1 2 2 2 2 2 2 1 1 1 2 2 1 1 1 1 2 2 1 2 1 1 2 2 1 1 2 2 2 1 1 1 2 1 1 2 1 2 2 1 2 2 2 2 1 1 1 2 1 2 2 2 2 2 1 2 1 1 1 2 2 2 2 2 1 2 1 1 2 2 2 1 1 2 2 1 2 2 2 1 1 1 2 1 1 1 2 1 1 2 2 2 1 2 1 1 1 2 2 1 1 2 2 2 2 2 2 1 2 2 1 2 2 2 1 1 2 2 1 1 2 1 1 1 1 2 1 1 1 2 2 1 2 1 1 2 2 1 1 2 1 2 1 1 1 2"],["100"]],[["247","2 2 1 2 1 2 2 2 2 2 2 1 1 2 2 1 2 1 1 1 2 1 1 1 1 2 1 1 2 2 1 2 1 1 1 2 2 2 1 1 2 1 1 2 1 1 1 2 1 2 1 2 2 1 1 2 1 2 2 1 2 1 2 1 1 2 1 1 1 2 2 1 1 2 2 1 1 2 1 1 1 2 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 1 1 1 1 1 1 1 1 1 2 1 2 2 1 2 1 2 2 2 1 2 2 2 1 1 2 2 1 1 1 2 1 1 1 1 2 2 1 2 2 1 1 1 2 1 2 2 1 2 1 1 1 2 2 2 2 2 1 2 2 2 1 1 1 2 1 2 1 1 2 2 2 2 1 1 2 2 2 1 2 2 2 1 2 1 1 2 2 2 2 1 2 2 1 1 1 2 1 2 1 1 1 2 2 1 1 2 1 1 2 1 2 1 1 2 1 1 1 1 2 1 1 1 1 2 2 1 2 1 1 2 1 2 2 1 2 2 2 1 2 2 1 2 2 1 1 1 2 2 2"],["123"]],[["4","2 2 2 2"],["0"]],[["4","1 1 1 1"],["1"]],[["2","1 1"],["0"]],[["2","2 1"],["1"]],[["2","1 2"],["1"]],[["3","1 1 2"],["1"]],[["3","1 2 2"],["1"]],[["3","2 1 1"],["1"]],[["3","2 1 2"],["1"]],[["3","2 2 1"],["1"]],[["4","1 1 1 2"],["1"]],[["4","1 1 2 2"],["2"]],[["4","1 2 2 2"],["1"]],[["4","2 1 1 1"],["1"]],[["5","1 1 1 1 2"],["2"]],[["14","1 2 2 2 2 2 2 2 2 2 2 2 2 2"],["1"]],[["38","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1"],["1"]],[["30","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1"],["1"]],[["20","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1"],["1"]],[["26","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2"],["1"]],[["6","1 1 1 2 2 2"],["3"]],[["5","2 1 1 1 1"],["2"]],[["9","1 1 1 1 1 1 2 2 2"],["4"]],[["10","2 2 1 1 1 1 1 1 1 1"],["4"]],[["6","1 1 1 1 1 1"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_113","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nin the function binaria that takes integer x, reference n and returns integer\n l, r = integers with l = 1, r = sqrt(n) + 1\n while l <= r\n mid = integer with mid = (l + r) \/ 2\n if mid * (mid + 1) is x\n return 1\n else if mid * (mid + 1) < x\n l = mid + 1\n else\n r = mid - 1\n end of the block\n return to indicate successful execution\nend of the block\ndefine the main function\n n = integer\n read n\n flag = bool with flag = false\n for i = 1 to sqrt(n * 2)\n if binaria(2 * n - i * (i + 1), n)\n flag = true\n break loop\n end of the block\n if not flag\n print NO\n else\n print YES\nend of the block\n\n[CODE]:","reference_output":"int binaria(int x, int &n) {\n int l = 1, r = sqrt(n) + 1;\n while (l <= r) {\n int mid = (l + r) \/ 2;\n if (mid * (mid + 1) == x)\n return 1;\n else if (mid * (mid + 1) < x)\n l = mid + 1;\n else\n r = mid - 1;\n }\n return 0;\n}\nint main() {\n int n;\n cin >> n;\n bool flag = false;\n for (int i = 1; i <= sqrt(n * 2); i++)\n if (binaria(2 * n - i * (i + 1), n)) {\n flag = true;\n break;\n }\n if (!flag)\n cout << \"NO\" << endl;\n else\n cout << \"YES\" << endl;\n}","item":{"problem_id":"192A","pseudocode":"in the function binaria that takes integer x, reference n and returns integer\n l, r = integers with l = 1, r = sqrt(n) + 1\n while l <= r\n mid = integer with mid = (l + r) \/ 2\n if mid * (mid + 1) is x\n return 1\n else if mid * (mid + 1) < x\n l = mid + 1\n else\n r = mid - 1\n end of the block\n return to indicate successful execution\nend of the block\ndefine the main function\n n = integer\n read n\n flag = bool with flag = false\n for i = 1 to sqrt(n * 2)\n if binaria(2 * n - i * (i + 1), n)\n flag = true\n break loop\n end of the block\n if not flag\n print NO\n else\n print YES\nend of the block","testcases":[[["256"],["YES"]],[["512"],["NO"]],[["80"],["NO"]],[["828"],["YES"]],[["6035"],["NO"]],[["39210"],["YES"]],[["79712"],["NO"]],[["190492"],["YES"]],[["5722367"],["NO"]],[["816761542"],["YES"]],[["1"],["NO"]],[["2"],["YES"]],[["3"],["NO"]],[["4"],["YES"]],[["5"],["NO"]],[["6"],["YES"]],[["7"],["YES"]],[["8"],["NO"]],[["9"],["YES"]],[["10"],["NO"]],[["12"],["YES"]],[["13"],["YES"]],[["14"],["NO"]],[["15"],["NO"]],[["16"],["YES"]],[["17"],["NO"]],[["18"],["YES"]],[["19"],["NO"]],[["20"],["YES"]],[["41"],["NO"]],[["11"],["YES"]],[["69"],["YES"]],[["82"],["NO"]],[["85"],["NO"]],[["736"],["NO"]],[["895"],["YES"]],[["934"],["YES"]],[["6213"],["YES"]],[["7405"],["NO"]],[["9919"],["NO"]],[["40942"],["YES"]],[["41992"],["NO"]],[["68535"],["NO"]],[["405718"],["NO"]],[["1046146"],["YES"]],[["3761248"],["YES"]],[["6195181"],["YES"]],[["35354345"],["NO"]],[["81282830"],["NO"]],[["187719774"],["NO"]],[["296798673"],["NO"]],[["938938476"],["NO"]],[["1000000000"],["NO"]],[["999887464"],["YES"]],[["999111944"],["NO"]],[["999966520"],["YES"]],[["999912080"],["NO"]],[["999992017"],["YES"]],[["999990474"],["NO"]],[["999999190"],["YES"]],[["999999125"],["NO"]],[["999999940"],["YES"]],[["999999995"],["NO"]],[["1000000000"],["NO"]],[["1"],["NO"]],[["999999999"],["YES"]],[["83495494"],["NO"]],[["968022000"],["YES"]],[["399980000"],["YES"]],[["4"],["YES"]],[["999999998"],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_114","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integers n, m\n create characters a, b\n read n read m\n for i = 0 to n exclusive\n for j = 0 to m exclusive\n if j is 0\n read a\n if i is not 0 and a is b\n print \"NO\\n\"\n return to indicate successful execution\n end of the block\n set b to a\n else\n read a\n if a is not b\n print \"NO\\n\"\n return to indicate successful execution\n end of the block\n end of the block\n end of the block\n print \"YES\\n\"\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, m;\n char a, b;\n cin >> n >> m;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n if (j == 0) {\n cin >> a;\n if (i != 0 && a == b) {\n cout << \"NO\\n\";\n return 0;\n }\n b = a;\n } else\n cin >> a;\n if (a != b) {\n cout << \"NO\\n\";\n return 0;\n }\n }\n }\n cout << \"YES\\n\";\n return 0;\n}","item":{"problem_id":"16A","pseudocode":"define the main function\n create integers n, m\n create characters a, b\n read n read m\n for i = 0 to n exclusive\n for j = 0 to m exclusive\n if j is 0\n read a\n if i is not 0 and a is b\n print \"NO\\n\"\n return to indicate successful execution\n end of the block\n set b to a\n else\n read a\n if a is not b\n print \"NO\\n\"\n return to indicate successful execution\n end of the block\n end of the block\n end of the block\n print \"YES\\n\"\n return to indicate successful execution\nend of the block","testcases":[[["3 3","000","111","222"],["YES"]],[["3 3","000","000","111"],["NO"]],[["3 3","000","111","002"],["NO"]],[["10 10","2222222222","5555555555","0000000000","4444444444","1111111111","3333333393","3333333333","5555555555","0000000000","8888888888"],["NO"]],[["10 13","4442444444444","8888888888888","6666666666666","0000000000000","3333333333333","4444444444444","7777777777777","8388888888888","1111111111111","5555555555555"],["NO"]],[["10 8","33333333","44444444","11111115","81888888","44444444","11111111","66666666","33330333","33333333","33333333"],["NO"]],[["5 5","88888","44444","66666","55555","88888"],["YES"]],[["20 19","1111111111111111111","5555555555555555555","0000000000000000000","3333333333333333333","1111111111111111111","2222222222222222222","4444444444444444444","5555555555555555555","0000000000000000000","4444444444444444444","0000000000000000000","5555555555555555555","7777777777777777777","9999999999999999999","2222222222222222222","4444444444444444444","1111111111111111111","6666666666666666666","7777777777777777777","2222222222222222222"],["YES"]],[["1 100","8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888"],["YES"]],[["100 1","5","7","9","4","7","2","5","1","6","7","2","7","6","8","7","4","0","2","9","8","9","1","6","4","3","4","7","1","9","3","0","8","3","1","7","5","3","9","5","1","3","5","8","1","9","3","9","0","6","0","7","6","5","2","8","3","7","6","5","1","8","3","6","9","6","0","5","8","5","2","9","1","0","1","8","3","2","1","0","3","9","0","5","1","0","4","9","3","0","4","8","4","8","6","3","0","4","6","8","4"],["YES"]],[["1 1","2"],["YES"]],[["1 100","1111111111111111111111111111111111111111111111111111111111111111111111111111181111111111111111111111"],["NO"]],[["100 1","3","6","4","3","0","2","8","7","3","2","1","7","1","3","2","3","6","9","0","8","5","9","7","9","2","1","4","5","1","9","2","5","1","4","6","4","9","1","0","2","1","4","7","1","4","8","0","9","2","1","6","2","8","6","9","5","8","6","4","5","9","2","7","4","1","5","8","0","9","5","4","6","5","0","6","3","6","9","7","2","0","9","7","3","2","4","9","4","7","1","2","3","1","7","9","1","9","0","4","0"],["YES"]]]}} +{"instance_id":"pseudo_to_code_0.5k_115","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate const int MAXN = 1005\ncreate character c\ndeclare integer array s with size MAXN\ncreate integers n and p\nfunction work2 with int argument x\n if x is greater than n\n for i from 1 to n inclusive, print s[i] + 'a' - 1 as char\n print a new line\n call exit with argument 0\n end of the block\n for i from 1 to p inclusive incrementing i\n declare boolean ch1 = (x - 1 <= 0 || i != s[x - 1])\n declare boolean ch2 = (x - 2 <= 0 || i != s[x - 2])\n if ch1 is true and ch2 is true\n assign i to s[x]\n call function work2 with arguments x + 1\n end of the block\n end of the block\nend of the block\nfunction work with int argument x\n while s[x] < p\n increment s[x] by one\n declare bool ch1 = (x - 1 <= 0 || s[x - 1] != s[x])\n create boolean ch2 = (x - 2 <= 0 || s[x - 2] != s[x])\n if ch1 && ch2 are both true, call work2(x + 1)\n end of the block\nend of the block\ndefine the main function\n read from the input to n and p\n for i = 1 to n inclusive, read c and set s[i] to c - 'a' + 1\n for integer i = n to 1 inclusive, decrementing i, call work(i)\n print \"NO\"\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int MAXN = 1005;\nchar c;\nint s[MAXN];\nint n, p;\nvoid work2(int x) {\n if (x > n) {\n for (int i = 1; i <= n; i++) cout << (char)(s[i] + 'a' - 1);\n cout << endl;\n exit(0);\n }\n for (int i = 1; i <= p; i++) {\n bool ch1 = (x - 1 <= 0 || i != s[x - 1]);\n bool ch2 = (x - 2 <= 0 || i != s[x - 2]);\n if (ch1 && ch2) {\n s[x] = i;\n work2(x + 1);\n }\n }\n}\nvoid work(int x) {\n while (s[x] < p) {\n s[x]++;\n bool ch1 = (x - 1 <= 0 || s[x - 1] != s[x]);\n bool ch2 = (x - 2 <= 0 || s[x - 2] != s[x]);\n if (ch1 && ch2) work2(x + 1);\n }\n}\nint main() {\n cin >> n >> p;\n for (int i = 1; i <= n; i++) cin >> c, s[i] = c - 'a' + 1;\n for (int i = n; i >= 1; i--) work(i);\n cout << \"NO\" << endl;\n return 0;\n}","item":{"problem_id":"464A","pseudocode":"create const int MAXN = 1005\ncreate character c\ndeclare integer array s with size MAXN\ncreate integers n and p\nfunction work2 with int argument x\n if x is greater than n\n for i from 1 to n inclusive, print s[i] + 'a' - 1 as char\n print a new line\n call exit with argument 0\n end of the block\n for i from 1 to p inclusive incrementing i\n declare boolean ch1 = (x - 1 <= 0 || i != s[x - 1])\n declare boolean ch2 = (x - 2 <= 0 || i != s[x - 2])\n if ch1 is true and ch2 is true\n assign i to s[x]\n call function work2 with arguments x + 1\n end of the block\n end of the block\nend of the block\nfunction work with int argument x\n while s[x] < p\n increment s[x] by one\n declare bool ch1 = (x - 1 <= 0 || s[x - 1] != s[x])\n create boolean ch2 = (x - 2 <= 0 || s[x - 2] != s[x])\n if ch1 && ch2 are both true, call work2(x + 1)\n end of the block\nend of the block\ndefine the main function\n read from the input to n and p\n for i = 1 to n inclusive, read c and set s[i] to c - 'a' + 1\n for integer i = n to 1 inclusive, decrementing i, call work(i)\n print \"NO\"\n return to indicate successful execution\nend of the block","testcases":[[["3 3","cba"],["NO"]],[["3 4","cba"],["cbd"]],[["4 4","abcd"],["abda"]],[["2 2","ab"],["ba"]],[["2 2","ba"],["NO"]],[["1 2","a"],["b"]],[["1 2","b"],["NO"]],[["1 1","a"],["NO"]],[["3 4","cdb"],["dab"]],[["7 26","zyxzyxz"],["NO"]],[["10 5","abcabcabca"],["abcabcabcd"]],[["10 10","fajegfaicb"],["fajegfaicd"]],[["1 26","o"],["p"]],[["1 2","b"],["NO"]],[["1 26","z"],["NO"]],[["3 3","cab"],["cba"]],[["3 26","yzx"],["zab"]],[["5 5","aceba"],["acebc"]],[["10 3","cbacbacbac"],["NO"]],[["11 3","abcabcabcab"],["acbacbacbac"]],[["12 10","abcabcabcabc"],["abcabcabcabd"]],[["13 7","gfegfegfegfeg"],["NO"]],[["15 11","cgjkbadjfbdaikj"],["cgjkbadjfbdajba"]],[["17 4","dabcadcbdcadbcdbc"],["dabcadcbdcadcabca"]],[["26 26","ahnxdnbfcriersyzdihuecojdi"],["ahnxdnbfcriersyzdihuecojdk"]],[["30 7","cedcfedcfgcfgcbadcadgfaegfacgf"],["cedcfedcfgcfgcbadcadgfaegfadba"]],[["70 4","dcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbd"],["NO"]],[["77 7","cadgbagbcaecgfaegcdbeafbacbdfgaedgcdeabgebaecbeacgfebagedcegdafdgeacegfegfegf"],["cadgbagbcaecgfaegcdbeafbacbdfgaedgcdeabgebaecbeacgfebagedcegdafdgeacfabcabcab"]],[["100 4","abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabca"],["abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcd"]],[["333 5","edcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedc"],["NO"]],[["3 3","acb"],["bac"]],[["17 26","bazyxzyxzyxzyxzyx"],["bcabcabcabcabcabc"]],[["6 3","acbacb"],["bacbac"]],[["6 3","abcabc"],["acbacb"]],[["302 4","abdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcb"],["acbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbac"]],[["30 26","abcabcabczyxzyxzyxzyxzyxzyxzyx"],["abcabcabdabcabcabcabcabcabcabc"]],[["300 3","abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc"],["acbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacb"]],[["2 4","cd"],["da"]]]}} +{"instance_id":"pseudo_to_code_0.5k_116","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create long longs n, k\n create 2d integer array a with size 3 by 10 with a = {{0, 1, 2, 2, 1, 0}, {1, 0, 0, 1, 2, 2}, {2, 2, 1, 0, 0, 1}}\n read n read k\n set n to n % 6\n for i = 0 to 3 exclusive\n if a[i][n] is k, print i print newline\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long n, k;\n int a[3][10] = {{0, 1, 2, 2, 1, 0}, {1, 0, 0, 1, 2, 2}, {2, 2, 1, 0, 0, 1}};\n cin >> n >> k;\n n = n % 6;\n for (int i = 0; i < 3; i++) {\n if (a[i][n] == k) cout << i << endl;\n }\n return 0;\n}","item":{"problem_id":"777A","pseudocode":"define the main function\n create long longs n, k\n create 2d integer array a with size 3 by 10 with a = {{0, 1, 2, 2, 1, 0}, {1, 0, 0, 1, 2, 2}, {2, 2, 1, 0, 0, 1}}\n read n read k\n set n to n % 6\n for i = 0 to 3 exclusive\n if a[i][n] is k, print i print newline\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["4","2"],["1"]],[["1","1"],["0"]],[["2","2"],["0"]],[["3","1"],["1"]],[["3","2"],["0"]],[["3","0"],["2"]],[["2000000000","0"],["1"]],[["2","0"],["1"]],[["2","1"],["2"]],[["4","0"],["2"]],[["4","1"],["0"]],[["5","0"],["0"]],[["5","1"],["2"]],[["5","2"],["1"]],[["6","0"],["0"]],[["6","1"],["1"]],[["6","2"],["2"]],[["7","0"],["1"]],[["7","1"],["0"]],[["7","2"],["2"]],[["100000","0"],["2"]],[["100000","1"],["0"]],[["100000","2"],["1"]],[["99999","1"],["1"]],[["99998","1"],["2"]],[["99997","1"],["0"]],[["99996","1"],["1"]],[["99995","1"],["2"]],[["1999999995","0"],["2"]],[["1999999995","1"],["1"]],[["1999999995","2"],["0"]],[["1999999996","0"],["2"]],[["1999999996","1"],["0"]],[["1999999996","2"],["1"]],[["1999999997","0"],["0"]],[["1999999997","1"],["2"]],[["1999999997","2"],["1"]],[["1999999998","0"],["0"]],[["1999999998","1"],["1"]],[["1999999998","2"],["2"]],[["1999999999","0"],["1"]],[["1999999999","1"],["0"]],[["1999999999","2"],["2"]],[["2000000000","1"],["2"]],[["2000000000","2"],["0"]],[["1234567890","0"],["0"]],[["1234567890","1"],["1"]],[["1234567890","2"],["2"]],[["123456789","0"],["2"]],[["123456789","1"],["1"]],[["123456789","2"],["0"]],[["123456790","0"],["2"]],[["12","2"],["2"]],[["32","1"],["2"]],[["20","2"],["0"]],[["10","1"],["0"]],[["1","0"],["1"]],[["76994383","1"],["0"]],[["25","2"],["2"]],[["1","2"],["2"]],[["12","0"],["0"]],[["150","2"],["2"]],[["15","0"],["2"]],[["21","2"],["0"]],[["18","2"],["2"]],[["8","2"],["0"]],[["10","0"],["2"]],[["16","0"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_117","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let t be a character\n read t\n let a, b be strings\n read a, b\n let s0 , s1 be characters with s0 is equal to a[1], s1 is equal to b[1]\n if a[0] is equal to A, a[0] is equal to Z\n if b[0] is equal to A, b[0] is equal to Z\n if a[0] is equal to T, a[0] is equal to B\n if b[0] is equal to T, b[0] is equal to B\n if a[0] is equal to K, a[0] is equal to X\n if b[0] is equal to K, b[0] is equal to X\n if s0 is equal to t and s1 is not equal to t\n print YES and newline\n return to indicate successful execution\n end of the block\n if s0 is equal to s1 and a[0] is greater than b[0]\n print YES and newline\n return to indicate successful execution\n end of the block\n print NO and newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n char t;\n cin >> t;\n string a, b;\n cin >> a >> b;\n char s0 = a[1], s1 = b[1];\n if (a[0] == 'A') a[0] = 'Z';\n if (b[0] == 'A') b[0] = 'Z';\n if (a[0] == 'T') a[0] = 'B';\n if (b[0] == 'T') b[0] = 'B';\n if (a[0] == 'K') a[0] = 'X';\n if (b[0] == 'K') b[0] = 'X';\n if (s0 == t && s1 != t) {\n cout << \"YES\" << endl;\n return 0;\n }\n if (s0 == s1 && a[0] > b[0]) {\n cout << \"YES\" << endl;\n return 0;\n }\n cout << \"NO\" << endl;\n return 0;\n}","item":{"problem_id":"106A","pseudocode":"define the main function\n let t be a character\n read t\n let a, b be strings\n read a, b\n let s0 , s1 be characters with s0 is equal to a[1], s1 is equal to b[1]\n if a[0] is equal to A, a[0] is equal to Z\n if b[0] is equal to A, b[0] is equal to Z\n if a[0] is equal to T, a[0] is equal to B\n if b[0] is equal to T, b[0] is equal to B\n if a[0] is equal to K, a[0] is equal to X\n if b[0] is equal to K, b[0] is equal to X\n if s0 is equal to t and s1 is not equal to t\n print YES and newline\n return to indicate successful execution\n end of the block\n if s0 is equal to s1 and a[0] is greater than b[0]\n print YES and newline\n return to indicate successful execution\n end of the block\n print NO and newline\n return to indicate successful execution\nend of the block","testcases":[[["H","QH 9S"],["YES"]],[["S","8D 6D"],["YES"]],[["C","7H AS"],["NO"]],[["C","KC 9C"],["YES"]],[["D","7D KD"],["NO"]],[["H","7H KD"],["YES"]],[["D","AS AH"],["NO"]],[["H","KH KS"],["YES"]],[["C","9H 6C"],["NO"]],[["C","9H JC"],["NO"]],[["D","TD JD"],["NO"]],[["H","6S 7S"],["NO"]],[["D","7S 8S"],["NO"]],[["S","8H 9H"],["NO"]],[["C","9D TD"],["NO"]],[["H","TC JC"],["NO"]],[["C","JH QH"],["NO"]],[["H","QD KD"],["NO"]],[["D","KS AS"],["NO"]],[["S","AH 6H"],["YES"]],[["H","7D 6D"],["YES"]],[["S","8H 7H"],["YES"]],[["D","9S 8S"],["YES"]],[["S","TC 9C"],["YES"]],[["H","JS TS"],["YES"]],[["S","QD JD"],["YES"]],[["D","KH QH"],["YES"]],[["H","AD KD"],["YES"]],[["H","QS QD"],["NO"]],[["C","TS TH"],["NO"]],[["C","6C 6D"],["YES"]],[["H","8H 8D"],["YES"]],[["S","7D 7S"],["NO"]],[["H","JC JH"],["NO"]],[["H","8H 9C"],["YES"]],[["D","9D 6S"],["YES"]],[["C","JC AH"],["YES"]],[["S","AS KD"],["YES"]],[["S","7S JS"],["NO"]],[["H","TH 8H"],["YES"]],[["S","7S QS"],["NO"]],[["C","KC QC"],["YES"]],[["S","AD 9S"],["NO"]],[["D","7H 8D"],["NO"]],[["H","JC 9H"],["NO"]],[["C","7S AC"],["NO"]],[["C","8C 7C"],["YES"]],[["H","9D 8S"],["NO"]],[["D","AC KS"],["NO"]],[["H","8C QH"],["NO"]],[["S","7S TS"],["NO"]],[["C","AH 6S"],["NO"]],[["S","KS QS"],["YES"]],[["H","AC QC"],["YES"]],[["S","9H 8D"],["NO"]],[["S","TS JS"],["NO"]],[["S","8H 7C"],["NO"]],[["C","AH 6S"],["NO"]],[["S","7S QS"],["NO"]],[["C","AH 6S"],["NO"]],[["S","TS KS"],["NO"]],[["C","TH KH"],["NO"]],[["H","9C 6D"],["NO"]],[["H","9C 8D"],["NO"]],[["H","TH AH"],["NO"]],[["H","TH JH"],["NO"]],[["H","QS 9C"],["NO"]],[["H","KC AC"],["NO"]],[["H","AH KH"],["YES"]],[["H","KS QS"],["YES"]],[["C","AD KS"],["NO"]],[["H","QS 9C"],["NO"]],[["H","9D 7S"],["NO"]],[["D","6D 9S"],["YES"]],[["H","AH KH"],["YES"]],[["H","KC AC"],["NO"]],[["D","8S 6C"],["NO"]],[["S","AC KC"],["YES"]]]}} +{"instance_id":"pseudo_to_code_0.5k_118","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n i, j, k, even, odd, n, x and y are ints with even and odd = 0, j = 1 and k = 2; a is an array of ints with size 56\n read input to n\n for i = 0 to n \/ 2 exclusive, read input to a[i]\n sort a from index 0 to n \/ 2\n for i = 0 to n \/ 2 exclusive\n assign j - a[i] to x\n if x is less than 0, invert the sign of x\n add x to odd\n assign k - a[i] to y\n if y is less than 0, invert the sign of y\n increase even by y\n add 2 to j\n add 2 to k\n end of the block\n if odd is greater than even\n print even\n else\n print odd\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int i, j = 1, k = 2, even = 0, odd = 0, n, x, y, a[56];\n cin >> n;\n for (i = 0; i < n \/ 2; i++) { cin >> a[i]; }\n sort(a, a + n \/ 2);\n for (i = 0; i < n \/ 2; i++) {\n x = j - a[i];\n if (x < 0) x = -x;\n odd += x;\n y = k - a[i];\n if (y < 0) y = -y;\n even += y;\n j += 2;\n k += 2;\n }\n if (odd > even)\n cout << even << endl;\n else\n cout << odd << endl;\n return 0;\n}","item":{"problem_id":"985A","pseudocode":"define the main function\n i, j, k, even, odd, n, x and y are ints with even and odd = 0, j = 1 and k = 2; a is an array of ints with size 56\n read input to n\n for i = 0 to n \/ 2 exclusive, read input to a[i]\n sort a from index 0 to n \/ 2\n for i = 0 to n \/ 2 exclusive\n assign j - a[i] to x\n if x is less than 0, invert the sign of x\n add x to odd\n assign k - a[i] to y\n if y is less than 0, invert the sign of y\n increase even by y\n add 2 to j\n add 2 to k\n end of the block\n if odd is greater than even\n print even\n else\n print odd\n return to indicate successful execution\nend of the block","testcases":[[["6","1 2 6"],["2"]],[["10","1 2 3 4 5"],["10"]],[["2","2"],["0"]],[["100","2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100"],["0"]],[["100","93 54 57 61 68 66 70 96 64 82 80 75 69 77 76 94 67 86 90 73 74 58 100 83 92 89 56 99 88 59 95 72 81 51 85 71 97 60 91 63 65 98 79 84 53 62 87 55 52 78"],["1225"]],[["100","41 13 29 11 25 15 6 23 28 50 48 17 3 9 44 24 5 19 34 22 33 32 20 16 35 37 4 10 46 2 39 40 47 49 36 42 1 30 43 21 14 7 18 45 31 8 12 26 27 38"],["1225"]],[["96","12 58 70 19 65 61 41 46 15 92 64 72 9 26 53 37 2 3 1 40 10 8 94 66 50 34 36 96 47 78 7 57 5 6 17 69 28 88 89 49 55 81 35 22 25 79 86 59"],["152"]],[["10","5 6 7 8 9"],["7"]],[["20","1 2 3 4 5 6 7 8 9 10"],["45"]],[["10","6 7 8 9 10"],["10"]],[["10","9 8 7 6 5"],["7"]],[["6","1 5 6"],["2"]],[["12","1 7 8 9 10 12"],["7"]],[["6","1 4 5"],["1"]],[["24","10 21 15 3 11 4 18 24 16 22 14 9"],["11"]],[["20","3 4 6 7 8 10 11 13 14 17"],["15"]],[["10","10 9 8 1 5"],["5"]],[["100","84 10 26 79 58 93 67 85 7 2 99 4 47 45 75 22 32 82 65 53 63 49 42 52 12 69 86 46 25 76 40 15 13 78 8 81 62 28 60 21 27 80 98 56 3 36 54 16 50 43"],["104"]],[["10","1 7 8 9 10"],["7"]],[["10","1 4 6 8 10"],["1"]],[["80","41 70 18 53 32 79 51 49 21 27 47 65 50 15 62 60 5 40 14 25 64 9 19 58 38 76 66 52 17 34 13 2 80 43 3 42 33 36 6 72"],["47"]],[["50","27 42 41 4 10 45 44 26 49 50 17 28 2 36 18 39 23 12 21 24 19 29 22 40 37"],["59"]],[["10","2 3 4 5 6"],["7"]],[["6","3 5 6"],["2"]],[["100","9 63 62 88 3 67 54 33 79 51 71 80 37 46 43 57 69 17 34 6 18 40 59 83 76 86 8 55 90 89 45 42 28 98 30 38 77 91 73 58 23 61 41 65 64 93 14 44 16 24"],["160"]],[["10","1 6 7 8 9"],["5"]],[["6","3 4 5"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_119","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate constant integer maxn = 110\ncreate integer array a of size maxn\ndefine the main function\n create integers i, j, n, and k\n read n and k\n for i = 0 to n exclusive, read a[i]\n create integers e, s, and maxx = -1\n for i = 0 to k exclusive\n set e to 0\n set s to 0\n for j = 0 to n exclusive\n if (j - i) modulo k is 0\n continue to next loop iteration\n else\n if a[j] is equal to 1\n increment e\n else if a[j] is equal to -1\n increment s\n end of the block\n end of the block\n set maxx to the max of maxx and the absolute value of e - s\n end of the block\n print maxx\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int maxn = 110;\nint a[maxn];\nint main() {\n int i, j, n, k;\n cin >> n >> k;\n for (i = 0; i < n; i++) { cin >> a[i]; }\n int e, s, maxx = -1;\n for (i = 0; i < k; i++) {\n e = 0;\n s = 0;\n for (j = 0; j < n; j++) {\n if ((j - i) % k == 0) {\n continue;\n } else {\n if (a[j] == 1)\n e++;\n else if (a[j] == -1)\n s++;\n }\n }\n maxx = max(maxx, abs(e - s));\n }\n cout << maxx << endl;\n return 0;\n}","item":{"problem_id":"1100A","pseudocode":"create constant integer maxn = 110\ncreate integer array a of size maxn\ndefine the main function\n create integers i, j, n, and k\n read n and k\n for i = 0 to n exclusive, read a[i]\n create integers e, s, and maxx = -1\n for i = 0 to k exclusive\n set e to 0\n set s to 0\n for j = 0 to n exclusive\n if (j - i) modulo k is 0\n continue to next loop iteration\n else\n if a[j] is equal to 1\n increment e\n else if a[j] is equal to -1\n increment s\n end of the block\n end of the block\n set maxx to the max of maxx and the absolute value of e - s\n end of the block\n print maxx\n return to indicate successful execution\nend of the block","testcases":[[["4 2","1 1 -1 1"],["2"]],[["14 3","-1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1"],["9"]],[["4 2","1 1 1 -1"],["2"]],[["4 2","-1 1 -1 -1"],["2"]],[["3 2","1 1 -1"],["1"]],[["20 2","-1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 1"],["6"]],[["20 19","-1 -1 1 1 -1 1 1 -1 1 1 -1 1 -1 1 1 1 -1 1 -1 1"],["5"]],[["20 7","-1 1 1 1 1 -1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 1"],["1"]],[["100 17","-1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 1 -1 1 1 1 -1 -1 1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 1 1 1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 1 1 -1 1 1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 -1 -1 1 1 1 1 -1 -1 1 1 1 -1 -1 1"],["12"]],[["20 12","-1 1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 -1 1 1 1 -1"],["6"]],[["20 17","-1 1 -1 1 1 1 -1 -1 -1 -1 -1 -1 1 -1 1 1 1 -1 1 -1"],["4"]],[["36 2","1 1 1 1 1 1 -1 -1 -1 1 1 1 -1 -1 -1 1 1 -1 1 1 1 1 -1 1 -1 1 -1 1 -1 1 1 -1 -1 1 1 1"],["10"]],[["36 35","-1 -1 1 1 1 1 -1 1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 1 1 1 1 -1 -1 -1 1 1 1 -1 -1 -1 1 1 1 -1"],["6"]],[["36 7","1 1 -1 1 1 1 1 -1 -1 1 1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 -1 -1 -1 -1 1 1 -1"],["5"]],[["36 12","-1 1 1 1 -1 -1 1 1 1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1 -1 1 -1 1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 -1"],["5"]],[["36 17","-1 1 -1 1 -1 -1 1 1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 1 1 1 1 -1 1 -1 1 -1 1 -1 -1 1"],["6"]],[["36 22","1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 1 1 -1 -1 -1 1 1 1 1 1 -1 -1 -1 1 1 1"],["8"]],[["36 27","1 1 -1 -1 1 -1 -1 -1 1 1 -1 1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1"],["8"]],[["36 32","1 1 -1 -1 -1 1 -1 1 1 -1 1 1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 1 -1 -1 -1 1 1 1 1 -1 -1 -1"],["8"]],[["52 2","1 1 -1 -1 -1 1 1 -1 1 1 1 1 -1 -1 -1 1 1 1 -1 -1 -1 1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 -1 1 -1 1 1 1 -1 -1"],["6"]],[["52 51","1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 1 1 1 1 1 1 1 1 1 1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 1 1 1 1 1 1 -1 -1 -1 1 -1 1 -1 -1 -1"],["5"]],[["52 7","1 1 -1 -1 1 1 -1 -1 1 1 1 1 1 -1 1 -1 1 1 -1 -1 1 1 1 -1 1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 1 1 1 -1 1 -1 1 1 -1 1 1"],["11"]],[["52 12","-1 1 -1 1 -1 -1 -1 1 -1 1 1 1 -1 1 1 1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 1 1 1 -1 1 -1 -1 1 -1 1 -1"],["5"]],[["52 17","-1 1 -1 1 -1 -1 -1 1 -1 1 -1 1 1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 1 1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 1 1 1"],["11"]],[["52 22","1 1 -1 1 1 1 -1 1 -1 -1 -1 1 1 -1 1 1 -1 -1 1 1 1 -1 -1 1 -1 1 -1 1 1 1 1 1 -1 -1 -1 1 1 -1 1 1 1 -1 -1 1 1 -1 1 1 -1 1 1 1"],["14"]],[["52 27","1 1 -1 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 1 -1 1 1 1 1 1 -1 1 1 -1 -1 1 -1 -1 -1 -1 -1 1 1 1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 -1"],["6"]],[["52 32","1 -1 -1 1 -1 1 1 -1 1 -1 1 -1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 -1"],["4"]],[["52 37","-1 -1 1 -1 -1 1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 1 -1 -1 1 -1 -1 1 1 1 -1 1 1 -1 1 -1 1 1"],["16"]],[["52 42","-1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1 1 1 1 1 -1 -1 1 -1 1 1 1"],["10"]],[["52 47","-1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 1 -1 1 1 1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 -1 -1 1 1 -1 1 1 1 -1 1 1 -1 -1 1 -1 1 1 -1"],["6"]],[["68 2","-1 1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 1 1 1 1 1 1 1 1 -1 -1 1 1 1 -1 1 1 -1 1 1 1 1 -1 -1 1 -1 -1 1 1 -1 1 1 1 1 -1 -1 1 1 -1 -1 -1 1 1 1 -1 -1 1 -1 -1 1 1 -1 1 1 -1 1"],["10"]],[["68 67","-1 -1 1 1 -1 -1 1 -1 -1 1 -1 1 1 1 1 -1 1 -1 1 -1 1 -1 1 -1 1 1 1 -1 1 1 -1 1 1 1 1 1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1"],["5"]],[["68 7","-1 1 1 -1 1 1 -1 1 1 -1 -1 1 1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 1 -1 1 1 1 -1 1 -1 -1 -1 -1 1 1 1 1 -1 1 1 -1 1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 1 1 1 -1 1 -1"],["14"]],[["68 12","-1 1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 1 1 -1 1 -1 1 -1 -1 1 1 1 -1 1 1 -1 1 1 -1 1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 1 1 1 1 1 1 -1 1 -1 -1 1 1 1 -1 1 1 -1 1 1 1 1 -1 1 1"],["12"]],[["68 17","-1 1 -1 1 -1 -1 -1 -1 1 1 1 -1 -1 1 -1 -1 -1 1 1 -1 1 -1 -1 1 1 -1 1 -1 1 -1 1 1 -1 1 -1 -1 1 1 -1 1 -1 1 -1 1 -1 1 1 1 1 -1 1 -1 -1 1 -1 1 1 1 -1 -1 1 1 -1 -1 1 1 1 -1"],["4"]],[["68 22","1 1 -1 1 1 1 -1 1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 1 1 1 1 1 1 1 -1 1 -1 -1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 1"],["3"]],[["68 27","1 1 -1 1 1 1 -1 1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 1 1 -1 1 -1 1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 1 1 1 -1 -1 -1 1 1 1 -1 1 -1"],["5"]],[["68 32","1 1 -1 -1 -1 -1 -1 -1 1 1 1 -1 1 1 1 1 -1 -1 1 -1 -1 -1 1 1 1 1 -1 1 -1 -1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 1"],["4"]],[["68 37","-1 -1 1 -1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 1 -1 -1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 1 -1 1 1 1 1 -1 1 -1 -1 -1 1 1 -1 1 -1 1 1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1"],["12"]],[["68 42","-1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 -1 1 -1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 1 -1 1 -1 1 1 1 1 1 1"],["18"]],[["68 47","-1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 -1 -1 1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 1 1 -1 1 1 1 -1"],["26"]],[["68 52","1 -1 1 -1 1 1 -1 1 -1 1 1 1 1 1 -1 1 -1 1 1 -1 1 1 1 -1 -1 -1 1 1 1 1 -1 -1 -1 1 1 -1 1 -1 -1 1 1 1 1 -1 1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 -1"],["6"]],[["68 57","1 -1 1 -1 1 1 -1 1 1 -1 1 1 -1 -1 1 -1 1 -1 -1 -1 1 -1 1 -1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 1 1 1 1 1 1 -1 1 -1 1 -1 -1 1 1 1 -1 1 -1 -1 1 -1 -1 1 -1"],["2"]],[["68 62","-1 -1 1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 1 1 1 1 1 1 1 1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 1 -1 1 1 1 1 1 -1 -1 1 -1"],["5"]],[["84 2","1 -1 1 -1 -1 -1 1 1 1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1 1 1 1 1 -1 -1 1 -1 1 1 1 1 -1 1 -1 1"],["8"]],[["84 83","1 -1 1 1 1 -1 -1 -1 1 -1 1 -1 1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 -1 -1 1 -1 1 -1 1 1 -1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 1 1 -1 1 1 -1 -1 1 1 -1 1 -1 1 -1 1 -1 1 -1 -1 -1 1 1 -1 1 1 1 -1 -1 1 1 -1 -1 1 1 1 1 -1"],["1"]],[["84 7","-1 -1 1 -1 1 -1 1 1 -1 -1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 -1 1 1 1 1 -1 1 -1 -1 1 1 1 1 1 1 1 -1 -1 -1 -1 1 1 1 1 -1 1 -1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 1 1 -1 1 1 1 -1 1 -1 1 -1 1 -1 1 -1 -1 1 -1"],["6"]],[["84 12","-1 1 -1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 1 -1 1 1 1 -1 1 1 1 1 1 -1 -1 1 1 -1 -1 -1 -1 1 1 -1 1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 -1 -1 -1 1 1 -1 1 1 -1 1 -1 1 1 1 -1 1 -1 1 -1 1 1 -1 -1"],["11"]],[["84 17","-1 1 1 -1 -1 1 -1 -1 1 1 1 1 1 -1 1 -1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 1 1 -1 1 1 1 1 1 -1 1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1 -1 -1 -1 1 1 -1 1 -1 -1 -1 -1 1 1"],["9"]],[["84 22","1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 1 -1 1 -1 -1 1 1 -1 -1 -1 -1 -1 1 1 1 1 -1 1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 1 1 1 -1 1 1 1 -1 1 1 -1 1 -1 1 -1 1 -1 1 1 -1 1 -1 1 1 1 1 -1 1 -1 1 1 1 1 -1 -1 1 -1 1 1 1"],["11"]],[["84 27","1 1 1 1 1 1 1 -1 -1 1 -1 1 -1 1 1 -1 -1 1 1 1 -1 1 -1 -1 1 1 -1 1 1 1 -1 1 1 -1 -1 1 -1 1 -1 1 -1 -1 -1 -1 1 1 1 -1 1 -1 -1 1 1 1 1 1 -1 -1 -1 1 1 1 1 1 1 1 -1 1 1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 1 -1"],["19"]],[["84 32","1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 -1 -1 1 -1 1 1 1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1 1 -1 1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 1 1 -1 -1 1 1 1 1 1 -1 1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1"],["7"]],[["84 37","-1 -1 1 1 1 -1 -1 1 -1 -1 1 1 1 1 1 -1 -1 1 -1 1 -1 1 -1 -1 1 1 1 1 1 -1 1 -1 -1 -1 -1 1 -1 -1 1 -1 1 1 1 -1 -1 -1 1 1 -1 1 1 -1 -1 -1 1 1 1 -1 1 -1 -1 -1 -1 -1 1 -1 1 1 1 -1 1 1 1 1 1 -1 -1 1 1 -1 1 1 -1 -1"],["7"]],[["84 42","-1 -1 1 1 -1 1 -1 -1 -1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 1 -1 1 1 1 -1 1 -1 1 -1 -1 1 1 1 1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 1 -1 1 -1 1 -1 1 -1 1 1 -1 1 1 -1 -1 -1 -1 1 -1 -1 -1 1 1 1 1 1 -1 -1 1 1 1 -1 1 -1"],["10"]],[["84 47","-1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 1 1 -1 1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 1 1 1 -1 1 1 1 1 -1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 1 -1 1 -1 1 -1 1 1 1"],["4"]],[["84 52","1 -1 1 -1 1 1 1 -1 1 1 1 -1 -1 1 1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 1 1 1 1 1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1"],["4"]],[["84 57","1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 1 1 -1 1 1 -1 1 1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 1 1 -1 1 -1 1 -1 1 1 1 -1 1 -1 1 1 -1 1 -1 1 -1 -1 -1"],["10"]],[["84 62","-1 -1 1 -1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 1 1 -1 1 1 -1 -1 1 1 -1 1 1 -1 1 1 1 1 1 1 1 1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 -1 1 1 -1 1 1 1 1 -1 -1 1 -1 -1 -1 -1 1 1 -1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 1"],["2"]],[["84 67","-1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 1 1 -1 1 1 -1 1 1 1 1 -1 1 1 1 1 -1 -1 -1 -1 -1 1 1 1 -1 1 1 1 1 1 1 1 -1 1 1 1 -1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1 1 1 1 -1 1 -1 1 1 -1 -1 -1 -1"],["4"]],[["84 72","1 1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 1 -1 1 1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 -1 1 -1 1 1 1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 1 -1"],["10"]],[["84 77","1 1 -1 1 -1 1 -1 1 1 1 1 1 1 1 1 -1 1 1 1 1 -1 1 -1 -1 1 -1 1 -1 1 1 1 1 -1 1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 -1 1 1 1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 1 -1 -1 -1 -1 -1 1 1"],["12"]],[["84 82","1 1 -1 1 1 1 1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 1 1 1 1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 -1 -1 1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 1 -1 1 -1 -1"],["9"]],[["100 2","-1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 1 -1 -1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 1 -1 -1 -1 1 1 1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 -1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 1 1 1 -1 1 -1 1 1 1 -1 1 1 -1 -1 -1 -1 1 1 1 1 1 1 1 -1 -1 -1 1 -1 1 -1"],["14"]],[["100 99","-1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 -1 -1 1 -1 1 1 1 -1 -1 1 -1 1 -1 1 -1 1 1 -1 1 1 -1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 1 1 -1 1 -1 1 -1 -1 1 1 1 1 -1 -1 -1 -1 -1 1 1 1 1 -1 -1 1 1 -1 1 -1 1 -1 -1 1 -1 1 1 1 1 -1 -1 -1 1 -1 1 -1 -1 -1 1 1 1 1 1"],["3"]],[["100 7","-1 -1 -1 -1 1 -1 1 1 -1 -1 1 -1 1 -1 -1 -1 1 1 -1 -1 1 1 1 1 1 -1 1 1 1 1 -1 1 1 1 -1 1 1 1 1 -1 -1 -1 1 1 -1 1 1 -1 1 -1 -1 -1 1 1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 1 -1 1 -1 -1 1 1"],["7"]],[["100 12","-1 -1 1 1 -1 -1 1 1 1 -1 1 -1 -1 1 1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 1 1 1 -1 1 1 -1 1 1 1 1 1 1 -1 1 -1 1 1 1 1 -1 -1 -1 1 1 1 -1 1 1 1 -1 1 1 -1 -1 -1 1 1 -1 -1 1 1 1 1 -1 1 1 -1 1 -1 1 1 1 1 1 -1 -1 -1 -1 -1"],["8"]],[["100 22","1 -1 1 1 1 1 -1 -1 -1 -1 -1 -1 1 -1 1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 1 -1 -1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 -1 -1 -1"],["18"]],[["100 27","1 1 1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 1 -1 1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 1 1 1 -1 1 -1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1 1 1 -1 1 -1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 1 1 -1 1 1 -1 1 1 -1 -1 -1 -1 1 1 -1 -1 1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1"],["15"]],[["100 32","1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 1 1 1 1 -1 1 1 -1 -1 1 1 1 -1 1 -1 -1 -1 -1 -1 1 1 1 -1 1 -1 1 1 1 1 -1 1 -1 1 1 -1 -1 1 -1 1 -1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 1 1 1 1 1 -1 -1 1 1 -1 -1 1 -1 1 -1 -1 1 1 -1 -1 1 1 -1 1"],["7"]],[["100 37","-1 1 -1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 1 1 1 -1 1 1 -1 1 1 1 1 -1 1 1 1 1 -1 1 1 1 1 -1 1 -1 -1 1 1 1 -1 -1 1 1 -1 1 1 -1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 1 1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 1 1 -1 -1 1 -1 -1 -1 -1"],["3"]],[["100 42","-1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 1 1 -1 -1 1 1 1 1 -1 1 -1 -1 1 1 -1 -1 -1 -1 -1 1 1 1 -1 -1 -1 -1 1 1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 1 -1 1 1 1 1 -1 1 -1 1 1 -1 1 -1 1 1 -1 1 -1 1 -1 1 -1 1 1 -1 -1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 1 1 -1 1 -1 1 1 1 1"],["13"]],[["100 47","-1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 1 1 1 1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 -1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1"],["19"]],[["100 52","1 1 -1 1 1 1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 -1 1 1 1 -1 1 -1 -1 -1 1 -1 1 -1 1 -1 -1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 1 1 1"],["10"]],[["100 57","1 1 -1 1 1 1 -1 -1 -1 1 1 1 1 -1 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 1 1 1 -1 -1 -1 -1 1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 -1 1 1 1 1 -1 1 1 -1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 1 1 -1 1 -1 -1 1 1 -1 1 -1 1 1 1 1 1 -1 -1 -1 1 -1 1 1 1 1 1"],["18"]],[["100 62","-1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 1 1 -1 1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 -1 1 1 1 -1 1 1 -1 -1 1 -1 1 1 1 1 1 1 1 -1 1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1"],["6"]],[["100 67","-1 -1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 1 1 1 1 1 -1 1 -1 -1 -1 -1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 -1 -1 -1 1 1 1 1 -1 -1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1 1 1 1 -1 1 -1 1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 1 1 -1 1 1 1 -1 1 1 -1 1 1 1 -1 1"],["4"]],[["100 72","1 -1 -1 1 1 -1 1 1 1 -1 1 1 -1 -1 1 1 1 -1 1 1 1 -1 -1 1 -1 -1 -1 1 1 1 1 -1 -1 1 -1 -1 1 1 1 1 -1 -1 1 1 -1 1 1 -1 1 -1 -1 -1 1 1 -1 1 1 1 1 -1 -1 1 -1 1 1 -1 -1 1 -1 1 -1 1 1 1 1 1 -1 -1 1 1 -1 1 -1 1 -1 1 1 1 1 -1 -1 1 1 -1 1 -1 -1 1 -1 -1"],["16"]],[["100 77","1 -1 1 -1 1 -1 -1 1 1 1 1 -1 1 -1 -1 -1 -1 1 1 1 -1 1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 1 -1 -1 -1 -1 -1 1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 1 -1 1 1 1 -1 1 -1 1"],["12"]],[["100 82","1 -1 1 -1 -1 1 -1 -1 1 -1 -1 -1 1 1 1 1 -1 1 -1 1 1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 1 1 1 1 1 -1 1 1 -1 1 1 -1 -1 1 -1 1 -1 1 -1 1 -1 1 1 1 -1 -1 1 -1 1 -1 1 -1 1 1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 1 -1 -1 1"],["4"]],[["100 87","-1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 1 1 -1 1 -1 1 -1 1 1 1 1 1 -1 1 1 -1 1 1 1 1 1 -1 1 1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 1 1 -1 1 1 -1 1 1 1 1 1 -1 -1 -1 -1 1 1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 1 -1 -1"],["8"]],[["100 92","-1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 1 1 -1 1 1 1 1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 1 1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 -1 1 1 -1 1 -1 1 -1 1 1 -1 1 1 -1 1 1 -1 -1 1 -1 1 1"],["8"]],[["100 97","-1 -1 1 -1 -1 -1 1 -1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 -1 1 -1 1 -1 -1 -1 -1 1 1 1 -1 -1 -1 1 1 1 1 1 -1 -1 1 -1 1 -1 1 -1 -1 -1 1 1 -1 1 1 -1 1 1 1 1 -1 -1 -1 1 -1 1 -1 1 1 -1 1 1 -1 1 1 1 1 -1 -1 -1 1 1 1 1 1 -1 1 1 -1 -1 -1 1 -1 -1 1 1 1 1 -1"],["3"]],[["4 3","-1 1 -1 -1"],["3"]],[["4 3","1 1 -1 1"],["3"]],[["3 2","1 1 1"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_120","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nINF = const long with INF = 2000000\na = long array of size 10000\ni, j = long\nn, m = long\ndefine the main function\n read n, m\n for i = 0 to m exclusive\n read j\n increment a[j]\n end of the block\n j = INF\n for i = 1 to n\n if (j > a[i]), j = a[i]\n print j\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const long INF = 2000000;\nlong a[10000];\nlong i, j;\nlong n, m;\nint main() {\n cin >> n >> m;\n for (i = 0; i < m; i++) {\n cin >> j;\n a[j]++;\n }\n j = INF;\n for (i = 1; i <= n; i++)\n if (j > a[i]) j = a[i];\n cout << j << endl;\n return 0;\n}","item":{"problem_id":"961A","pseudocode":"INF = const long with INF = 2000000\na = long array of size 10000\ni, j = long\nn, m = long\ndefine the main function\n read n, m\n for i = 0 to m exclusive\n read j\n increment a[j]\n end of the block\n j = INF\n for i = 1 to n\n if (j > a[i]), j = a[i]\n print j\n return to indicate successful execution\nend of the block","testcases":[[["3 9","1 1 2 2 2 3 1 2 3"],["2"]],[["1 7","1 1 1 1 1 1 1"],["7"]],[["1 1","1"],["1"]],[["3 5","1 1 1 2 3"],["1"]],[["4 6","4 4 4 4 4 4"],["0"]],[["4 6","2 3 4 4 4 4"],["0"]],[["3 12","1 1 1 1 2 2 2 2 3 3 3 3"],["4"]],[["8 8","2 2 3 4 5 6 7 8"],["0"]],[["100 1","50"],["0"]],[["2 1","2"],["0"]],[["2 1","1"],["0"]],[["2 4","1 2 1 1"],["1"]],[["3 4","3 2 2 2"],["0"]],[["2 2","2 2"],["0"]],[["2 5","2 1 1 2 1"],["2"]],[["15 3","13 14 15"],["0"]],[["4 9","1 2 3 1 2 3 1 2 3"],["0"]],[["100 3","1 2 3"],["0"]],[["1000 10","999 999 998 34 454 546 343 35 34 1000"],["0"]],[["4 2","1 2"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_121","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare tp with integer a as argument, returning boolean\n if a is less than 2, return false from function\n for i = 2 to i * i is less than or equal to a, incrementing i\n if a % i is 0, return false from function\n end of the block\n return true from function\nend of the block\ndeclare cm with integer a as argument\n create integer lt with lt = 2\n for i = 3 to a inclusive\n if result of run tp with i as argument is true\n if lt + i is a, return true from function\n if lt + i is greater than a, return false from function\n set lt to i\n end of the block\n end of the block\n return false from function\nend of the block\ncreate integers n, k, cnt\ndefine the main function\n read n read k\n for i = 2 to n inclusive\n if result of run tp with i as argument is true\n create integer p with p = i - 1\n if result of run cm with p as argument is true, increment cnt\n end of the block\n end of the block\n if cnt is greater than or equal to k\n print \"YES\" print newline\n else\n print \"NO\" print newline\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"bool tp(int a) {\n if (a < 2) { return false; }\n for (int i = 2; i * i <= a; i++) {\n if (a % i == 0) { return false; }\n }\n return true;\n}\nbool cm(int a) {\n int lt = 2;\n for (int i = 3; i <= a; i++) {\n if (tp(i)) {\n if (lt + i == a) { return true; }\n if (lt + i > a) { return false; }\n lt = i;\n }\n }\n return false;\n}\nint n, k, cnt;\nint main() {\n cin >> n >> k;\n for (int i = 2; i <= n; i++) {\n if (tp(i)) {\n int p = i - 1;\n if (cm(p)) { cnt++; }\n }\n }\n if (cnt >= k) {\n cout << \"YES\" << endl;\n } else {\n cout << \"NO\" << endl;\n }\n return 0;\n}","item":{"problem_id":"17A","pseudocode":"declare tp with integer a as argument, returning boolean\n if a is less than 2, return false from function\n for i = 2 to i * i is less than or equal to a, incrementing i\n if a % i is 0, return false from function\n end of the block\n return true from function\nend of the block\ndeclare cm with integer a as argument\n create integer lt with lt = 2\n for i = 3 to a inclusive\n if result of run tp with i as argument is true\n if lt + i is a, return true from function\n if lt + i is greater than a, return false from function\n set lt to i\n end of the block\n end of the block\n return false from function\nend of the block\ncreate integers n, k, cnt\ndefine the main function\n read n read k\n for i = 2 to n inclusive\n if result of run tp with i as argument is true\n create integer p with p = i - 1\n if result of run cm with p as argument is true, increment cnt\n end of the block\n end of the block\n if cnt is greater than or equal to k\n print \"YES\" print newline\n else\n print \"NO\" print newline\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["27 2"],["YES"]],[["45 7"],["NO"]],[["2 0"],["YES"]],[["15 1"],["YES"]],[["17 1"],["YES"]],[["34 5"],["NO"]],[["37 4"],["YES"]],[["43 5"],["YES"]],[["47 7"],["NO"]],[["50 5"],["YES"]],[["57 6"],["YES"]],[["60 8"],["NO"]],[["62 7"],["YES"]],[["76 9"],["NO"]],[["69 7"],["YES"]],[["113 10"],["YES"]],[["141 11"],["YES"]],[["207 16"],["NO"]],[["231 18"],["NO"]],[["296 19"],["YES"]],[["332 20"],["YES"]],[["378 24"],["NO"]],[["428 23"],["YES"]],[["497 27"],["NO"]],[["640 32"],["YES"]],[["798 35"],["YES"]],[["802 35"],["YES"]],[["864 40"],["NO"]],[["953 44"],["NO"]],[["995 44"],["YES"]],[["1000 44"],["YES"]],[["1000 0"],["YES"]],[["1000 1000"],["NO"]],[["2 1000"],["NO"]],[["2 0"],["YES"]]]}} +{"instance_id":"pseudo_to_code_0.5k_122","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n a is a new array of ints with 6 elements; i, j, k, sum, flg and b are integers with sum, flg and b = 0 and j = 1\n for i = 0 to 6 exclusive\n read b from the user input\n assign b to a[i] if 0 <= b and b <= 1000\n end of the block\n start for loop from i = 0 to 6 exclusive, increasing sum by a[i] on each loop iteration\n if sum is even\n in a for loop, change i from 0 to 4 exclusive incrementing i\n for j = i + 1 to 5 exclusive\n change k from j + 1 to 6 exclusive incrementing k in a for loop\n if a[i] + a[j] + a[k] is equal to sum \/ 2\n change flg to 1\n stop the loop\n end of the block\n end of the block\n if flg is equal to 1, break\n end of the block\n if flg is equal to 1, break\n end of the block\n if flg is equal to 1\n print \"YES\"\n else\n print \"NO\" to the standard output\n end of the block\n else\n print \"NO\"\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int a[6], i, j = 1, k, sum = 0, flg = 0, b = 0;\n for (i = 0; i < 6; i++) {\n cin >> b;\n if (0 <= b && b <= 1000) { a[i] = b; }\n }\n for (i = 0; i < 6; i++) { sum += a[i]; }\n if (sum % 2 == 0) {\n for (i = 0; i < 4; i++) {\n for (j = i + 1; j < 5; j++) {\n for (k = j + 1; k < 6; k++) {\n if (a[i] + a[j] + a[k] == (sum \/ 2)) {\n flg = 1;\n break;\n }\n }\n if (flg == 1) { break; }\n }\n if (flg == 1) { break; }\n }\n if (flg == 1) {\n cout << \"YES\" << endl;\n } else {\n cout << \"NO\" << endl;\n }\n } else\n cout << \"NO\" << endl;\n}","item":{"problem_id":"886A","pseudocode":"define the main function\n a is a new array of ints with 6 elements; i, j, k, sum, flg and b are integers with sum, flg and b = 0 and j = 1\n for i = 0 to 6 exclusive\n read b from the user input\n assign b to a[i] if 0 <= b and b <= 1000\n end of the block\n start for loop from i = 0 to 6 exclusive, increasing sum by a[i] on each loop iteration\n if sum is even\n in a for loop, change i from 0 to 4 exclusive incrementing i\n for j = i + 1 to 5 exclusive\n change k from j + 1 to 6 exclusive incrementing k in a for loop\n if a[i] + a[j] + a[k] is equal to sum \/ 2\n change flg to 1\n stop the loop\n end of the block\n end of the block\n if flg is equal to 1, break\n end of the block\n if flg is equal to 1, break\n end of the block\n if flg is equal to 1\n print \"YES\"\n else\n print \"NO\" to the standard output\n end of the block\n else\n print \"NO\"\nend of the block","testcases":[[["1 3 2 1 2 1"],["YES"]],[["1 1 1 1 1 99"],["NO"]],[["1000 1000 1000 1000 1000 1000"],["YES"]],[["0 0 0 0 0 0"],["YES"]],[["633 609 369 704 573 416"],["NO"]],[["353 313 327 470 597 31"],["NO"]],[["835 638 673 624 232 266"],["NO"]],[["936 342 19 398 247 874"],["NO"]],[["417 666 978 553 271 488"],["NO"]],[["71 66 124 199 67 147"],["YES"]],[["54 26 0 171 239 12"],["YES"]],[["72 8 186 92 267 69"],["YES"]],[["180 179 188 50 75 214"],["YES"]],[["16 169 110 136 404 277"],["YES"]],[["101 400 9 200 300 10"],["YES"]],[["101 400 200 9 300 10"],["YES"]],[["101 200 400 9 300 10"],["YES"]],[["101 400 200 300 9 10"],["YES"]],[["101 200 400 300 9 10"],["YES"]],[["4 4 4 4 5 4"],["NO"]],[["2 2 2 2 2 1"],["NO"]],[["1000 1000 999 1000 1000 1000"],["NO"]],[["129 1 10 29 8 111"],["NO"]],[["1000 1000 1000 999 999 1000"],["YES"]],[["101 200 300 400 9 10"],["YES"]],[["101 400 200 300 10 9"],["YES"]],[["101 200 400 300 10 9"],["YES"]],[["101 200 300 400 10 9"],["YES"]],[["101 200 300 10 400 9"],["YES"]],[["1 1 1 1 1 5"],["NO"]],[["8 1 1 3 3 0"],["NO"]],[["1 1 2 2 3 3"],["YES"]],[["1 2 2 5 2 5"],["NO"]],[["1 2 3 6 6 6"],["NO"]],[["36 91 7 86 51 89"],["NO"]],[["10 1 1 1 23 24"],["NO"]],[["1 1 1 10 23 24"],["NO"]],[["20 10 1 2 3 44"],["NO"]],[["7 0 14 11 8 6"],["NO"]],[["100 496 1 1 1 1"],["NO"]],[["5 4 2 5 11 3"],["NO"]],[["1 3 7 8 8 9"],["YES"]],[["1 3 4 5 18 19"],["YES"]],[["5 5 1 2 2 15"],["NO"]],[["2 1 0 0 0 5"],["NO"]],[["1 6 6 1 20 2"],["NO"]],[["2 10 0 0 0 0"],["NO"]],[["1 1 3 1 1 11"],["NO"]],[["10 10 1 1 1 37"],["NO"]],[["1 1 0 0 0 4"],["NO"]],[["1 1 10 1 1 28"],["NO"]],[["1 5 5 5 6 8"],["YES"]],[["0 2 3 4 4 5"],["YES"]]]}} +{"instance_id":"pseudo_to_code_0.5k_123","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let n, m, max, idx = integers with max = -1\n let x = float\n read n, m\n for integer i=0 to n exclusive do the following\n read x\n set x = round up of x \/ m\n if x is greater than or equal to max do the following\n set max = x\n set idx = i\n end of the block\n end of the block\n print idx + 1\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, m, max = -1, idx;\n float x;\n cin >> n >> m;\n for (int i = 0; i < n; i++) {\n cin >> x;\n x = ceil(x \/ m);\n if (x >= max) {\n max = x;\n idx = i;\n }\n }\n cout << (idx + 1) << endl;\n return 0;\n}","item":{"problem_id":"450A","pseudocode":"define the main function\n let n, m, max, idx = integers with max = -1\n let x = float\n read n, m\n for integer i=0 to n exclusive do the following\n read x\n set x = round up of x \/ m\n if x is greater than or equal to max do the following\n set max = x\n set idx = i\n end of the block\n end of the block\n print idx + 1\n return to indicate successful execution\nend of the block","testcases":[[["5 2","1 3 1 4 2"],["4"]],[["6 4","1 1 2 2 3 3"],["6"]],[["7 3","6 1 5 4 2 3 1"],["4"]],[["10 5","2 7 3 6 2 5 1 3 4 5"],["4"]],[["100 1","1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100"],["100"]],[["9 3","9 5 2 3 7 1 8 4 6"],["7"]],[["20 10","58 4 32 10 73 7 30 39 47 6 59 21 24 66 79 79 46 13 29 58"],["16"]],[["50 5","89 56 3 2 40 37 56 52 83 59 43 83 43 59 29 74 22 58 53 41 53 67 78 30 57 32 58 29 95 46 45 85 60 49 41 82 8 71 52 40 45 26 6 71 84 91 4 93 40 54"],["48"]],[["50 1","4 3 9 7 6 8 3 7 10 9 8 8 10 2 9 3 2 4 4 10 4 6 8 10 9 9 4 2 8 9 4 4 9 5 1 5 2 4 4 9 10 2 5 10 7 2 8 6 8 1"],["44"]],[["50 5","3 9 10 8 3 3 4 6 8 2 9 9 3 1 2 10 6 8 7 2 7 4 2 7 5 10 2 2 2 5 10 5 6 6 8 7 10 4 3 2 10 8 6 6 8 6 4 4 1 3"],["46"]],[["50 2","56 69 72 15 95 92 51 1 74 87 100 29 46 54 18 81 84 72 84 83 20 63 71 27 45 74 50 89 48 8 21 15 47 3 39 73 80 84 6 99 17 25 56 3 74 64 71 39 89 78"],["40"]],[["50 3","31 39 64 16 86 3 1 9 25 54 98 42 20 3 49 41 73 37 55 62 33 77 64 22 33 82 26 13 10 13 7 40 48 18 46 79 94 72 19 12 11 61 16 37 10 49 14 94 48 69"],["11"]],[["50 100","67 67 61 68 42 29 70 77 12 61 71 27 4 73 87 52 59 38 93 90 31 27 87 47 26 57 76 6 28 72 81 68 50 84 69 79 39 93 52 6 88 12 46 13 90 68 71 38 90 95"],["50"]],[["100 3","4 14 20 11 19 11 14 20 5 7 6 12 11 17 5 11 7 6 2 10 13 5 12 8 5 17 20 18 7 19 11 7 7 20 20 8 10 17 17 19 20 5 15 16 19 7 11 16 4 17 2 10 1 20 20 16 19 9 9 11 5 7 12 9 9 6 20 18 13 19 8 4 8 1 2 4 10 11 15 14 1 7 17 12 13 19 12 2 3 14 15 15 5 17 14 12 17 14 16 9"],["86"]],[["100 5","16 8 14 16 12 11 17 19 19 2 8 9 5 6 19 9 11 18 6 9 14 16 14 18 17 17 17 5 15 20 19 7 7 10 10 5 14 20 5 19 11 16 16 19 17 9 7 12 14 10 2 11 14 5 20 8 10 11 19 2 14 14 19 17 5 10 8 8 4 2 1 10 20 12 14 11 7 6 6 15 1 5 9 15 3 17 16 17 5 14 11 9 16 15 1 11 10 6 15 7"],["93"]],[["100 1","58 94 18 50 17 14 96 62 83 80 75 5 9 22 25 41 3 96 74 45 66 37 2 37 13 85 68 54 77 11 85 19 25 21 52 59 90 61 72 89 82 22 10 16 3 68 61 29 55 76 28 85 65 76 27 3 14 10 56 37 86 18 35 38 56 68 23 88 33 38 52 87 55 83 94 34 100 41 83 56 91 77 32 74 97 13 67 31 57 81 53 39 5 88 46 1 79 4 49 42"],["77"]],[["100 2","1 51 76 62 34 93 90 43 57 59 52 78 3 48 11 60 57 48 5 54 28 81 87 23 44 77 67 61 14 73 29 53 21 89 67 41 47 9 63 37 1 71 40 85 4 14 77 40 78 75 89 74 4 70 32 65 81 95 49 90 72 41 76 55 69 83 73 84 85 93 46 6 74 90 62 37 97 7 7 37 83 30 37 88 34 16 11 59 85 19 57 63 85 20 63 97 97 65 61 48"],["97"]],[["100 3","30 83 14 55 61 66 34 98 90 62 89 74 45 93 33 31 75 35 82 100 63 69 48 18 99 2 36 71 14 30 70 76 96 85 97 90 49 36 6 76 37 94 70 3 63 73 75 48 39 29 13 2 46 26 9 56 1 18 54 53 85 34 2 12 1 93 75 67 77 77 14 26 33 25 55 9 57 70 75 6 87 66 18 3 41 69 73 24 49 2 20 72 39 58 91 54 74 56 66 78"],["20"]],[["100 4","69 92 76 3 32 50 15 38 21 22 14 3 67 41 95 12 10 62 83 52 78 1 18 58 94 35 62 71 58 75 13 73 60 34 50 97 50 70 19 96 53 10 100 26 20 39 62 59 88 26 24 83 70 68 66 8 6 38 16 93 2 91 81 89 78 74 21 8 31 56 28 53 77 5 81 5 94 42 77 75 92 15 59 36 61 18 55 45 69 68 81 51 12 42 85 74 98 31 17 41"],["97"]],[["100 5","2 72 10 60 6 50 72 34 97 77 35 43 80 64 40 53 46 6 90 22 29 70 26 68 52 19 72 88 83 18 55 32 99 81 11 21 39 42 41 63 60 97 30 23 55 78 89 35 24 50 99 52 27 76 24 8 20 27 51 37 17 82 69 18 46 19 26 77 52 83 76 65 43 66 84 84 13 30 66 88 84 23 37 1 17 26 11 50 73 56 54 37 40 29 35 8 1 39 50 82"],["51"]],[["100 7","6 73 7 54 92 33 66 65 80 47 2 53 28 59 61 16 54 89 37 48 77 40 49 59 27 52 17 22 78 80 81 80 8 93 50 7 87 57 29 16 89 55 20 7 51 54 30 98 44 96 27 70 1 1 32 61 22 92 84 98 31 89 91 90 28 56 49 25 86 49 55 16 19 1 18 8 88 47 16 18 73 86 2 96 16 91 74 49 38 98 94 25 34 85 29 27 99 31 31 58"],["97"]],[["100 9","36 4 45 16 19 6 10 87 44 82 71 49 70 35 83 19 40 76 45 94 44 96 10 54 82 77 86 63 11 37 21 3 15 89 80 88 89 16 72 23 25 9 51 25 10 45 96 5 6 18 51 31 42 57 41 51 42 15 89 61 45 82 16 48 61 67 19 40 9 33 90 36 78 36 79 79 16 10 83 87 9 22 84 12 23 76 36 14 2 81 56 33 56 23 57 84 76 55 35 88"],["47"]],[["100 10","75 81 39 64 90 58 92 28 75 9 96 78 92 83 77 68 76 71 14 46 58 60 80 25 78 11 13 63 22 82 65 68 47 6 33 63 90 50 85 43 73 94 80 48 67 11 83 17 22 15 94 80 66 99 66 4 46 35 52 1 62 39 96 57 37 47 97 49 64 12 36 63 90 16 4 75 85 82 85 56 13 4 92 45 44 93 17 35 22 46 18 44 29 7 52 4 100 98 87 51"],["98"]],[["100 20","21 19 61 70 54 97 98 14 61 72 25 94 24 56 55 25 12 80 76 11 35 17 80 26 11 94 52 47 84 61 10 2 74 25 10 21 2 79 55 50 30 75 10 64 44 5 60 96 52 16 74 41 20 77 20 44 8 86 74 36 49 61 99 13 54 64 19 99 50 43 12 73 48 48 83 55 72 73 63 81 30 27 95 9 97 82 24 3 89 90 33 14 47 88 22 78 12 75 58 67"],["94"]],[["100 30","56 79 59 23 11 23 67 82 81 80 99 79 8 58 93 36 98 81 46 39 34 67 3 50 4 68 70 71 2 21 52 30 75 23 33 21 16 100 56 43 8 27 40 8 56 24 17 40 94 10 67 49 61 36 95 87 17 41 7 94 33 19 17 50 26 11 94 54 38 46 77 9 53 35 98 42 50 20 43 6 78 6 38 24 100 45 43 16 1 50 16 46 14 91 95 88 10 1 50 19"],["95"]],[["100 40","86 11 97 17 38 95 11 5 13 83 67 75 50 2 46 39 84 68 22 85 70 23 64 46 59 93 39 80 35 78 93 21 83 19 64 1 49 59 99 83 44 81 70 58 15 82 83 47 55 65 91 10 2 92 4 77 37 32 12 57 78 11 42 8 59 21 96 69 61 30 44 29 12 70 91 14 10 83 11 75 14 10 19 39 8 98 5 81 66 66 79 55 36 29 22 45 19 24 55 49"],["88"]],[["100 50","22 39 95 69 94 53 80 73 33 90 40 60 2 4 84 50 70 38 92 12 36 74 87 70 51 36 57 5 54 6 35 81 52 17 55 100 95 81 32 76 21 1 100 1 95 1 40 91 98 59 84 19 11 51 79 19 47 86 45 15 62 2 59 77 31 68 71 92 17 33 10 33 85 57 5 2 88 97 91 99 63 20 63 54 79 93 24 62 46 27 30 87 3 64 95 88 16 50 79 1"],["99"]],[["100 70","61 48 89 17 97 6 93 13 64 50 66 88 24 52 46 99 6 65 93 64 82 37 57 41 47 1 84 5 97 83 79 46 16 35 40 7 64 15 44 96 37 17 30 92 51 67 26 3 14 56 27 68 66 93 36 39 51 6 40 55 79 26 71 54 8 48 18 2 71 12 55 60 29 37 31 97 26 37 25 68 67 70 3 87 100 41 5 82 65 92 24 66 76 48 89 8 40 93 31 95"],["100"]],[["100 90","87 32 30 15 10 52 93 63 84 1 82 41 27 51 75 32 42 94 39 53 70 13 4 22 99 35 44 38 5 23 18 100 61 80 9 12 42 93 9 77 3 7 60 95 66 78 95 42 69 8 1 88 93 66 96 20 76 63 15 36 92 52 2 72 36 57 48 63 29 20 74 88 49 47 81 61 94 74 70 93 47 3 19 52 59 41 5 40 22 3 76 97 91 37 95 88 91 99 76 15"],["98"]],[["100 100","79 75 7 28 6 96 38 35 57 95 41 74 24 96 32 78 81 13 63 84 24 95 3 23 66 1 60 6 96 49 41 5 14 18 31 97 66 19 49 89 49 70 51 28 20 99 18 1 28 77 24 46 69 21 40 32 31 66 28 6 66 97 9 16 70 90 91 30 34 82 93 41 65 11 39 52 1 88 63 43 80 50 60 49 28 56 18 76 24 57 74 1 28 99 36 35 79 54 18 16"],["100"]],[["1 3","5"],["1"]],[["1 1","100"],["1"]],[["2 3","4 2"],["1"]],[["2 5","99 97"],["2"]],[["3 4","7 5 2"],["2"]],[["3 50","47 86 51"],["3"]],[["5 100","82 100 85 1 37"],["5"]],[["5 20","40 39 21 5 20"],["3"]],[["1 27","81"],["1"]],[["20 13","7 8 29 83 74 28 93 85 7 8 3 9 8 70 49 50 39 41 57 1"],["7"]],[["2 1","100 2"],["1"]],[["2 2","6 4"],["1"]],[["5 2","6 4 4 1 1"],["1"]],[["1 4","3"],["1"]],[["3 2","1 5 3"],["2"]],[["3 1","3 2 2"],["1"]],[["3 1","2 3 2"],["2"]],[["5 1","5 1 1 1 1"],["1"]],[["2 3","7 4"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_124","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let a be an array of characters of length 10\n read 9 characters into a\n for i = 0 to 5 exclusive\n if a[i] != a[8 - i]\n print \"NO\" and a new line\n return to indicate successful execution\n end of the block\n end of the block\n print \"YES\" and a new line\nend of the block\n\n[CODE]:","reference_output":"int main() {\n char a[10];\n for (int i = 0; i < 9; i++) { cin >> a[i]; }\n for (int i = 0; i < 5; i++) {\n if (a[i] != a[8 - i]) {\n cout << \"NO\" << endl;\n return 0;\n }\n }\n cout << \"YES\" << endl;\n}","item":{"problem_id":"12A","pseudocode":"define the main function\n let a be an array of characters of length 10\n read 9 characters into a\n for i = 0 to 5 exclusive\n if a[i] != a[8 - i]\n print \"NO\" and a new line\n return to indicate successful execution\n end of the block\n end of the block\n print \"YES\" and a new line\nend of the block","testcases":[[["XX.","...",".XX"],["YES"]],[[".X.",".X.",".X."],["YES"]],[["XXX","XXX","XXX"],["YES"]],[["XXX","X.X","XXX"],["YES"]],[["X..",".X.","..X"],["YES"]],[["...","X.X","X.."],["NO"]],[[".X.","X.X",".X."],["YES"]],[["X.X",".X.","X.X"],["YES"]],[["...","...","..X"],["NO"]],[["XXX","...","XXX"],["YES"]],[["..X","X..","..X"],["NO"]],[[".X.","...","X.X"],["NO"]],[["X.X","X.X","X.X"],["YES"]],[[".X.","X.X","XX."],["NO"]],[["...","XXX","XXX"],["NO"]],[["XXX","..X","XXX"],["NO"]],[["X..","X.X",".X."],["NO"]],[["...","..X","XXX"],["NO"]],[["..X","X.X","X.."],["YES"]],[["..X","..X","XXX"],["NO"]],[["X..","X..","X.."],["NO"]],[["XXX",".X.","XXX"],["YES"]],[["..X","...","X.."],["YES"]],[["...","...","X.."],["NO"]],[["...","...",".X."],["NO"]],[["...","...","..X"],["NO"]],[["...",".X.","X.."],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_125","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n s = string\n loop while reading s\n len = int with len = length of s\n print (len + 1) * 26 - len\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string s;\n while (cin >> s) {\n int len = s.length();\n cout << (len + 1) * 26 - len << endl;\n }\n return 0;\n}","item":{"problem_id":"554A","pseudocode":"define the main function\n s = string\n loop while reading s\n len = int with len = length of s\n print (len + 1) * 26 - len\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["a"],["51"]],[["hi"],["76"]],[["y"],["51"]],[["kgan"],["126"]],[["zoabkyuvus"],["276"]],[["spyemhyznjieyhhbk"],["451"]],[["xulsyfkuizjauadjjopu"],["526"]],[["e"],["51"]],[["zv"],["76"]],[["jgv"],["101"]],[["zsfo"],["126"]],[["jselr"],["151"]],[["dwemig"],["176"]],[["mddoxsf"],["201"]],[["jgirkrmi"],["226"]],[["spkxurcum"],["251"]],[["fykkiubdkt"],["276"]],[["fznbcxsxygs"],["301"]],[["qcrvrdqcbtou"],["326"]],[["qktrbjzrqgmlr"],["351"]],[["foamodbvptlxxg"],["376"]],[["ydzpjhsidipricw"],["401"]],[["lpfpndmjfvqejdgf"],["426"]],[["ofkvparuvjtggnmab"],["451"]],[["xxncfutrtxcwdzwbgs"],["476"]],[["zovhffccflkgqncsdte"],["501"]],[["cskgsxywlvfeicoueglr"],["526"]],[["gggggggggggggggggggg"],["526"]],[["qdqdddqddqqddqddqdqd"],["526"]],[["takttttaakaaktakttkt"],["526"]],[["coccoooogogcgocccmcg"],["526"]],[["kskkskkkssksssk"],["401"]],[["lllllllllllllll"],["401"]]]}} +{"instance_id":"pseudo_to_code_0.5k_126","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create strings ans, s\n read s\n create integer i with size of s \/ 2 - 1\n if size of s % 2 is 1, increment i\n create integer p with p = i + 1\n for i is less than or equal to 0, decrementing i, incrementing p\n add element s[i] to end of ans\n if p is less than size of s, add element s[p] to end of ans\n end of the block\n print ans print newline\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string ans, s;\n cin >> s;\n int i = s.size() \/ 2 - 1;\n if (s.size() % 2 == 1) i++;\n int p = i + 1;\n for (; i >= 0; i--, p++) {\n ans.push_back(s[i]);\n if (p < s.size()) ans.push_back(s[p]);\n }\n cout << ans << endl;\n}","item":{"problem_id":"1085A","pseudocode":"define the main function\n create strings ans, s\n read s\n create integer i with size of s \/ 2 - 1\n if size of s % 2 is 1, increment i\n create integer p with p = i + 1\n for i is less than or equal to 0, decrementing i, incrementing p\n add element s[i] to end of ans\n if p is less than size of s, add element s[p] to end of ans\n end of the block\n print ans print newline\nend of the block","testcases":[[["ncteho"],["techno"]],[["erfdcoeocs"],["codeforces"]],[["z"],["z"]],[["bz"],["bz"]],[["tea"],["eat"]],[["code"],["odce"]],[["qwertyuioasdfghjklrtyuiodfghjklqwertyuioasdfssddxb"],["dfogihujyktlrqlwkejrhtgyfudisoaaosidufystsrdedwxqb"]],[["qwertyuioasdfghjklrtyuiodfghjklqwertyuioasdfssd"],["odifugyhtjrkllkqjwhegrftdysuaiooiausydtfrseswdq"]],[["testa"],["steat"]],[["abcdef"],["cdbeaf"]],[["abcdefg"],["decfbga"]],[["qwertyuioasdfghjklrtyuiodfghjklqwertyuioasdfssdda"],["dfogihujyktlrqlwkejrhtgyfudisoaaosidufystsrdedwaq"]],[["zqwertyuioasdfghjklrtyuiodfghjklqwertyuioasdfssd"],["ioudyftgrhljkkjlhqgwfedrstayouiiuoyatsrdefwsqszd"]],[["gecabdfh"],["abcdefgh"]],[["aechs"],["chesa"]]]}} +{"instance_id":"pseudo_to_code_0.5k_127","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create int a, b, c, d, k, set k to 0\n read a, b and c\n create int n\n read n\n for i=0 to n exclusive\n read d\n if d greater than b and d less than c, increment k\n end of the block\n print k\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int a, b, c, d, k = 0;\n cin >> a >> b >> c;\n int n;\n cin >> n;\n for (int i = 0; i < n; i++) {\n cin >> d;\n if (d > b && d < c) k++;\n }\n cout << k << endl;\n}","item":{"problem_id":"794A","pseudocode":"define the main function\n create int a, b, c, d, k, set k to 0\n read a, b and c\n create int n\n read n\n for i=0 to n exclusive\n read d\n if d greater than b and d less than c, increment k\n end of the block\n print k\nend of the block","testcases":[[["5 3 7","8","4 7 5 5 3 6 2 8"],["4"]],[["6 5 7","5","1 5 7 92 3"],["0"]],[["3 2 4","1","3"],["1"]],[["5 3 8","12","8 3 4 5 7 6 8 3 5 4 7 6"],["8"]],[["7 3 10","5","3 3 3 3 3"],["0"]],[["3 2 5","4","1 3 4 5"],["2"]],[["3 2 4","1","1"],["0"]],[["6 4 8","1","4"],["0"]],[["2 1 3","1","3"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_128","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n,s,a,b,c,d=int, pos=1\n read n,a,b,c,d\n s=a+b+c+d\n decrement n\n while decremented value of n is not zero\n read a,b,c,d\n if a+b+c+d > s increment pos\n end of the block\n print pos\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, s, a, b, c, d, pos = 1;\n cin >> n >> a >> b >> c >> d;\n s = a + b + c + d;\n n--;\n while (n--) {\n cin >> a >> b >> c >> d;\n if (a + b + c + d > s) { pos++; }\n }\n cout << pos << '\\n';\n return 0;\n}","item":{"problem_id":"1017A","pseudocode":"define the main function\n n,s,a,b,c,d=int, pos=1\n read n,a,b,c,d\n s=a+b+c+d\n decrement n\n while decremented value of n is not zero\n read a,b,c,d\n if a+b+c+d > s increment pos\n end of the block\n print pos\n return to indicate successful execution\nend of the block","testcases":[[["5","100 98 100 100","100 100 100 100","100 100 99 99","90 99 90 100","100 98 60 99"],["2"]],[["6","100 80 90 99","60 60 60 60","90 60 100 60","60 100 60 80","100 100 0 100","0 0 0 0"],["1"]],[["1","0 0 0 0"],["1"]],[["1","15 71 57 86"],["1"]],[["5","4 8 2 6","8 3 5 2","7 9 5 10","7 10 10 7","7 6 7 3"],["4"]],[["9","1 2 1 1","2 2 2 2","3 3 3 3","4 4 4 4","5 5 5 5","6 6 6 6","7 7 7 7","8 8 8 8","9 9 9 9"],["9"]],[["8","19 12 11 0","10 3 14 5","9 9 5 12","4 9 1 4","19 17 9 0","20 16 10 13","8 13 16 3","10 0 9 19"],["3"]],[["18","68 32 84 6","44 53 11 21","61 34 77 82","19 36 47 58","47 73 31 96","17 50 82 16","57 90 64 8","14 37 45 69","48 1 18 58","42 34 96 14","56 82 33 77","40 66 30 53","33 31 44 95","0 90 24 8","7 85 39 1","76 77 93 35","98 9 62 13","24 84 60 51"],["8"]]]}} +{"instance_id":"pseudo_to_code_0.5k_129","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare character arrays m1 = \"1\", m2 = \"14\", m3 =\"144\"\n declare character array a size 1000\n declare integers i, j, k, l\n read a\n for i = 0 to a[i]\n if a[i] is m3[0] and a[i+1] is m3[1] and a[i+2] is m3[2]\n increment i by 3\n else if a[i] is m2[0] and a[i+1] is m2[1]\n increment i by 2\n else if a[i] is m1[0]\n increment i by 1\n else\n print \"NO\\n\"\n exit program with code 0\n end of the block\n end of the block\n print \"YES\\n\"\nend of the block\n\n[CODE]:","reference_output":"int main() {\n char m1[] = \"1\", m2[] = \"14\", m3[] = \"144\";\n char a[1000];\n int i, j, k, l;\n cin >> a;\n for (i = 0; a[i];) {\n if (a[i] == m3[0] && a[i + 1] == m3[1] && a[i + 2] == m3[2])\n i += 3;\n else if (a[i] == m2[0] && a[i + 1] == m2[1])\n i += 2;\n else if (a[i] == m1[0])\n i += 1;\n else {\n cout << \"NO\\n\";\n exit(0);\n }\n }\n cout << \"YES\\n\";\n}","item":{"problem_id":"320A","pseudocode":"define the main function\n declare character arrays m1 = \"1\", m2 = \"14\", m3 =\"144\"\n declare character array a size 1000\n declare integers i, j, k, l\n read a\n for i = 0 to a[i]\n if a[i] is m3[0] and a[i+1] is m3[1] and a[i+2] is m3[2]\n increment i by 3\n else if a[i] is m2[0] and a[i+1] is m2[1]\n increment i by 2\n else if a[i] is m1[0]\n increment i by 1\n else\n print \"NO\\n\"\n exit program with code 0\n end of the block\n end of the block\n print \"YES\\n\"\nend of the block","testcases":[[["114114"],["YES"]],[["1111"],["YES"]],[["441231"],["NO"]],[["1"],["YES"]],[["14"],["YES"]],[["114"],["YES"]],[["9"],["NO"]],[["414"],["NO"]],[["1000000000"],["NO"]],[["144144144"],["YES"]],[["1444"],["NO"]],[["11"],["YES"]],[["141414141"],["YES"]],[["11110111"],["NO"]],[["114114144"],["YES"]],[["444"],["NO"]],[["9999"],["NO"]],[["111444"],["NO"]],[["11114"],["YES"]],[["41111"],["NO"]],[["114414441"],["NO"]],[["144414441"],["NO"]],[["144244144"],["NO"]],[["111111111"],["YES"]],[["144444444"],["NO"]],[["444444444"],["NO"]],[["141441441"],["YES"]],[["441"],["NO"]],[["15"],["NO"]],[["14444"],["NO"]],[["11444"],["NO"]],[["144"],["YES"]],[["1414414"],["YES"]],[["141444"],["NO"]],[["14144"],["YES"]],[["4"],["NO"]],[["1144"],["YES"]],[["141111444"],["NO"]],[["14414414"],["YES"]],[["141414144"],["YES"]],[["1414"],["YES"]],[["1441"],["YES"]],[["12"],["NO"]],[["144144141"],["YES"]],[["144144"],["YES"]],[["14414411"],["YES"]],[["14414"],["YES"]]]}} +{"instance_id":"pseudo_to_code_0.5k_130","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nn, d = integers with vis, lvl = arrays of 200 integers\nst = string\nin function bfs\n Q = queue of integers\n set all contents of vis to -1\n push 0 in Q\n lvl[0] = 0\n u = integer\n while not Q is empty\n set u to the front of Q\n pop Q\n if u is n - 1 then return lvl[u]\n for i = u + 1 to u + d inclusive\n if vis[i] is -1 and st[i] is character 1\n vis[i] = 1\n set lvl[i] to lvl[u] + 1\n push i in Q\n end of the block\n end of the block\n end of the block\n return -1\nend of the block\ndefine the main function\n read n and d\n read st\n print the result of fuction bfs\nend of the block\n\n[CODE]:","reference_output":"int n, d, vis[200], lvl[200];\nstring st;\nint bfs() {\n queue Q;\n memset(vis, -1, sizeof(vis));\n Q.push(0);\n lvl[0] = 0;\n int u;\n while (!Q.empty()) {\n u = Q.front();\n Q.pop();\n if (u == n - 1) return lvl[u];\n for (int i = u + 1; i <= u + d; i++) {\n if (vis[i] == -1 && st[i] == '1') {\n vis[i] = 1;\n lvl[i] = lvl[u] + 1;\n Q.push(i);\n }\n }\n }\n return -1;\n}\nint main() {\n cin >> n >> d;\n cin >> st;\n cout << bfs() << \"\\n\";\n}","item":{"problem_id":"910A","pseudocode":"n, d = integers with vis, lvl = arrays of 200 integers\nst = string\nin function bfs\n Q = queue of integers\n set all contents of vis to -1\n push 0 in Q\n lvl[0] = 0\n u = integer\n while not Q is empty\n set u to the front of Q\n pop Q\n if u is n - 1 then return lvl[u]\n for i = u + 1 to u + d inclusive\n if vis[i] is -1 and st[i] is character 1\n vis[i] = 1\n set lvl[i] to lvl[u] + 1\n push i in Q\n end of the block\n end of the block\n end of the block\n return -1\nend of the block\ndefine the main function\n read n and d\n read st\n print the result of fuction bfs\nend of the block","testcases":[[["8 4","10010101"],["2"]],[["4 2","1001"],["-1"]],[["8 4","11100101"],["3"]],[["12 3","101111100101"],["4"]],[["5 4","11011"],["1"]],[["5 4","10001"],["1"]],[["10 7","1101111011"],["2"]],[["10 9","1110000101"],["1"]],[["10 9","1100000001"],["1"]],[["20 5","11111111110111101001"],["4"]],[["20 11","11100000111000011011"],["2"]],[["20 19","10100000000000000001"],["1"]],[["50 13","10011010100010100111010000010000000000010100000101"],["5"]],[["50 8","11010100000011001100001100010001110000101100110011"],["8"]],[["99 4","111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111111111111"],["25"]],[["99 98","100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"],["1"]],[["100 5","1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"],["20"]],[["100 4","1111111111111111111111111111111111111111111111111111111111111111111111111111110111111111111111111111"],["25"]],[["100 4","1111111111111111111111111111111111111111111111111111111111111101111111011111111111111111111111111111"],["25"]],[["100 3","1111110111111111111111111111111111111111101111111111111111111111111101111111111111111111111111111111"],["34"]],[["100 8","1111111111101110111111111111111111111111111111111111111111111111111111110011111111111111011111111111"],["13"]],[["100 7","1011111111111111111011101111111011111101111111111101111011110111111111111111111111110111111011111111"],["15"]],[["100 9","1101111110111110101111111111111111011001110111011101011111111111010101111111100011011111111010111111"],["12"]],[["100 6","1011111011111111111011010110011001010101111110111111000111011011111110101101110110101111110000100111"],["18"]],[["100 7","1110001111101001110011111111111101111101101001010001101000101100000101101101011111111101101000100001"],["16"]],[["100 11","1000010100011100011011100000010011001111011110100100001011010100011011111001101101110110010110001101"],["10"]],[["100 9","1001001110000011100100000001000110111101101010101001000101001010011001101100110011011110110011011111"],["13"]],[["100 7","1010100001110101111011000111000001110100100110110001110110011010100001100100001110111100110000101001"],["18"]],[["100 10","1110110000000110000000101110100000111000001011100000100110010001110111001010101000011000000001011011"],["12"]],[["100 13","1000000100000000100011000010010000101010011110000000001000011000110100001000010001100000011001011001"],["9"]],[["100 11","1000000000100000010000100001000100000000010000100100000000100100001000000001011000110001000000000101"],["12"]],[["100 22","1000100000001010000000000000000001000000100000000000000000010000000000001000000000000000000100000001"],["7"]],[["100 48","1000000000000000011000000000000000000000000000000001100000000000000000000000000000000000000000000001"],["3"]],[["100 48","1000000000000000000000100000000000000000000000000000000000000000000001000000000000000000100000000001"],["3"]],[["100 75","1000000100000000000000000000000000000000000000000000000000000000000000000000000001000000000000000001"],["3"]],[["100 73","1000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000001"],["2"]],[["100 99","1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"],["1"]],[["100 1","1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"],["99"]],[["100 2","1111111111111111111111111111111110111111111111111111111111111111111111111111111111111111111111111111"],["50"]],[["100 1","1111111111111111011111111111111111111111111111111111111111111111111101111111111111111111111111111111"],["-1"]],[["100 3","1111111111111111111111111101111111111111111111111011111111111111111111111111111011111111111111111111"],["33"]],[["100 1","1101111111111111111111101111111111111111111111111111111111111011111111101111101111111111111111111111"],["-1"]],[["100 6","1111111111111111111111101111111101011110001111111111111111110111111111111111111111111110010111111111"],["17"]],[["100 2","1111111101111010110111011011110111101111111011111101010101011111011111111111111011111001101111101111"],["-1"]],[["100 8","1100110101111001101001111000111100110100011110111011001011111110000110101000001110111011100111011011"],["14"]],[["100 10","1000111110100000001001101100000010011100010101001100010011111001001101111110110111101111001010001101"],["11"]],[["100 7","1110000011010001110101011010000011110001000000011101110111010110001000011101111010010001101111110001"],["-1"]],[["100 3","1111010001000001011011000011001111000100101000101101000010111101111000010000011110110011001101010111"],["-1"]],[["100 9","1101010101101100010111011000010100001010000101010011001001100010110110000000010000101000000001101101"],["13"]],[["100 14","1010100000000000010101000010001100000000000011100010000001000001011010001110001010100000100001101101"],["9"]],[["100 13","1000000001101001110000010000011001000000000000001010000000100001001010000000000000000100010000000001"],["-1"]],[["100 18","1000000000000000110000000000000000010000000001000001000001000000000100000000000010000000000000000001"],["-1"]],[["100 32","1000000000000000000000000001000000000000000000000101000000000000000000000000000000000001000000000001"],["-1"]],[["100 79","1000000001000000000101000000000000000000000000000000000000000000000000000000000000000000000000000001"],["2"]],[["100 41","1000000000000000000000000000000000010000000000000000000000000000000000000000100000000000000000000001"],["3"]],[["100 82","1000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000001"],["2"]],[["100 96","1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"],["-1"]],[["43 30","1001000001111111010100100100110101011101101"],["2"]],[["7 1","1111111"],["6"]],[["9 3","101000001"],["-1"]],[["10 3","1100000001"],["-1"]],[["8 2","10000101"],["-1"]],[["2 1","11"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_131","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, b =integers\n Read n\n set b to n \/ 2 + 1\n print b and a new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, b;\n cin >> n;\n b = n \/ 2 + 1;\n cout << b << endl;\n return 0;\n}","item":{"problem_id":"964A","pseudocode":"define the main function\n n, b =integers\n Read n\n set b to n \/ 2 + 1\n print b and a new line\n return to indicate successful execution\nend of the block","testcases":[[["7"],["4"]],[["8"],["5"]],[["9"],["5"]],[["1"],["1"]],[["286"],["144"]],[["48"],["25"]],[["941"],["471"]],[["45154"],["22578"]],[["60324"],["30163"]],[["91840"],["45921"]],[["41909"],["20955"]],[["58288"],["29145"]],[["91641"],["45821"]],[["62258"],["31130"]],[["79811"],["39906"]],[["88740"],["44371"]],[["12351"],["6176"]],[["1960"],["981"]],[["29239"],["14620"]],[["85801"],["42901"]],[["43255"],["21628"]],[["13439"],["6720"]],[["35668"],["17835"]],[["19122"],["9562"]],[["60169"],["30085"]],[["50588"],["25295"]],[["2467"],["1234"]],[["39315"],["19658"]],[["29950"],["14976"]],[["17286"],["8644"]],[["7359066"],["3679534"]],[["1016391"],["508196"]],[["7928871"],["3964436"]],[["3968891"],["1984446"]],[["2636452"],["1318227"]],[["5076901"],["2538451"]],[["9870265"],["4935133"]],[["2453786"],["1226894"]],[["7263670"],["3631836"]],[["1890845"],["945423"]],[["574128507"],["287064254"]],[["648476655"],["324238328"]],[["97349542"],["48674772"]],[["716489761"],["358244881"]],[["858771038"],["429385520"]],[["520778784"],["260389393"]],[["439004204"],["219502103"]],[["589992198"],["294996100"]],[["371106544"],["185553273"]],[["894241590"],["447120796"]],[["123957268"],["61978635"]],[["234149297"],["117074649"]],[["789954052"],["394977027"]],[["667978920"],["333989461"]],[["154647261"],["77323631"]],[["751453521"],["375726761"]],[["848862308"],["424431155"]],[["323926781"],["161963391"]],[["576768825"],["288384413"]],[["31293802"],["15646902"]],[["2"],["2"]],[["1000000000"],["500000001"]],[["3"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_132","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nk, a, b, v, tot = int\ndefine the main function\n read k then a then b then v\n iterate i\n increment to by (min of b + 1, k) * v\n decrement b by min of (b, k - 1)\n if tot >= a\n print i\n return to indicate successful execution\n end of the block\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int k, a, b, v, tot;\nint main() {\n cin >> k >> a >> b >> v;\n for (int i = 1;; i++) {\n tot += (min(b + 1, k)) * v;\n b -= (min(b, k - 1));\n if (tot >= a) {\n cout << i << endl;\n return 0;\n }\n }\n}","item":{"problem_id":"402A","pseudocode":"k, a, b, v, tot = int\ndefine the main function\n read k then a then b then v\n iterate i\n increment to by (min of b + 1, k) * v\n decrement b by min of (b, k - 1)\n if tot >= a\n print i\n return to indicate successful execution\n end of the block\n end of the block\nend of the block","testcases":[[["3 10 3 3"],["2"]],[["3 10 1 3"],["3"]],[["100 100 1 1000"],["1"]],[["5 347 20 1"],["327"]],[["6 978 10 5"],["186"]],[["6 856 50 35"],["5"]],[["8 399 13 36"],["2"]],[["4 787 48 4"],["149"]],[["4 714 7 6"],["112"]],[["7 915 12 24"],["27"]],[["8 995 3 28"],["33"]],[["10 267 4 48"],["2"]],[["10 697 1 34"],["20"]],[["7 897 49 42"],["4"]],[["10 849 3 28"],["28"]],[["477 492 438 690"],["1"]],[["461 790 518 105"],["1"]],[["510 996 830 417"],["1"]],[["763 193 388 346"],["1"]],[["958 380 405 434"],["1"]],[["346 991 4 4"],["244"]],[["648 990 5 2"],["490"]],[["810 1000 6 5"],["194"]],[["683 995 10 1"],["985"]],[["307 999 10 7"],["133"]],[["974 999 3 4"],["247"]],[["60 1000 2 2"],["498"]],[["634 993 9 3"],["322"]],[["579 990 8 9"],["102"]],[["306 993 9 9"],["102"]],[["845 996 1 1"],["995"]],[["872 997 1 1"],["996"]],[["2 990 1 1"],["989"]],[["489 992 1 1"],["991"]],[["638 1000 1 1"],["999"]],[["2 4 1000 1"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_133","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate new array of characters str with size 1007\nvis is a new array of booleans with 1007 elements\ndefine the main function\n read str from the input\n change vis['a'], vis['e'], vis['i'], vis['o'] and vis['u'] to true\n for i from 0 to exclusive incrementing i\n if vis[str[i]] is false and str[i] != 'n'\n if vis[str[i + 1]] is false, return 0 * puts(\"NO\")\n print \"YES\" to stdout\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"char str[1007];\nbool vis[1007];\nint main() {\n cin >> str;\n vis['a'] = vis['e'] = vis['i'] = vis['o'] = vis['u'] = true;\n for (int i = 0; str[i]; i++)\n if (!vis[str[i]] && str[i] != 'n')\n if (!vis[str[i + 1]]) return 0 * puts(\"NO\");\n puts(\"YES\");\n return 0;\n}","item":{"problem_id":"1008A","pseudocode":"create new array of characters str with size 1007\nvis is a new array of booleans with 1007 elements\ndefine the main function\n read str from the input\n change vis['a'], vis['e'], vis['i'], vis['o'] and vis['u'] to true\n for i from 0 to exclusive incrementing i\n if vis[str[i]] is false and str[i] != 'n'\n if vis[str[i + 1]] is false, return 0 * puts(\"NO\")\n print \"YES\" to stdout\n return to indicate successful execution\nend of the block","testcases":[[["sumimasen"],["YES"]],[["ninja"],["YES"]],[["codeforces"],["NO"]],[["auuaoonntanonnuewannnnpuuinniwoonennyolonnnvienonpoujinndinunnenannmuveoiuuhikucuziuhunnnmunzancenen"],["YES"]],[["n"],["YES"]],[["necnei"],["NO"]],[["nternn"],["NO"]],[["aucunuohja"],["NO"]],[["a"],["YES"]],[["b"],["NO"]],[["nn"],["YES"]],[["nnnzaaa"],["YES"]],[["zn"],["NO"]],[["ab"],["NO"]],[["aaaaaaaaaa"],["YES"]],[["aaaaaaaaab"],["NO"]],[["aaaaaaaaan"],["YES"]],[["baaaaaaaaa"],["YES"]],[["naaaaaaaaa"],["YES"]],[["nbaaaaaaaa"],["YES"]],[["bbaaaaaaaa"],["NO"]],[["bnaaaaaaaa"],["NO"]],[["eonwonojannonnufimiiniewuqaienokacevecinfuqihatenhunliquuyebayiaenifuexuanenuaounnboancaeowonu"],["YES"]],[["uixinnepnlinqaingieianndeakuniooudidonnnqeaituioeneiroionxuowudiooonayenfeonuino"],["NO"]],[["nnnnnyigaveteononnnnxaalenxuiiwannntoxonyoqonlejuoxuoconnnentoinnul"],["NO"]],[["ndonneasoiunhomuunnhuitonnntunntoanerekonoupunanuauenu"],["YES"]],[["anujemogawautiedoneobninnibonuunaoennnyoorufonxionntinimiboonununnnnnleenqunminzayoutanlalo"],["NO"]],[["y"],["NO"]],[["by"],["NO"]],[["yy"],["NO"]],[["nbn"],["NO"]],[["nz"],["NO"]],[["king"],["NO"]],[["g"],["NO"]],[["az"],["NO"]],[["x"],["NO"]],[["z"],["NO"]],[["yn"],["NO"]],[["aeo"],["YES"]],[["nb"],["NO"]],[["npn"],["NO"]],[["kini"],["YES"]],[["pya"],["NO"]],[["m"],["NO"]],[["p"],["NO"]],[["aaaaaaaak"],["NO"]],[["aab"],["NO"]],[["d"],["NO"]],[["at"],["NO"]],[["aaaaaak"],["NO"]],[["aaz"],["NO"]],[["aaab"],["NO"]],[["s"],["NO"]],[["nzzen"],["NO"]],[["aeionnhhhn"],["NO"]],[["h"],["NO"]],[["ny"],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_134","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integer n and an array of integers a with size 100010\n read n and keep looping\n declare long long variable sum = 0\n create integer minn = 1e9\n for integer i = 1 to n inclusive\n read a[i]\n if a[i] is odd\n if a[i] is less than minn, change minn to a[i]\n end of the block\n increase sum by a[i]\n end of the block\n if sum is even\n print sum\n else\n print sum - minn\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, a[100010];\n while (cin >> n) {\n long long sum = 0;\n int minn = 1e9;\n for (int i = 1; i <= n; i++) {\n cin >> a[i];\n if (a[i] % 2 != 0) {\n if (a[i] < minn) minn = a[i];\n }\n sum += a[i];\n }\n if (sum % 2 == 0)\n cout << sum << endl;\n else\n cout << sum - minn << endl;\n }\n return 0;\n}","item":{"problem_id":"621A","pseudocode":"define the main function\n create integer n and an array of integers a with size 100010\n read n and keep looping\n declare long long variable sum = 0\n create integer minn = 1e9\n for integer i = 1 to n inclusive\n read a[i]\n if a[i] is odd\n if a[i] is less than minn, change minn to a[i]\n end of the block\n increase sum by a[i]\n end of the block\n if sum is even\n print sum\n else\n print sum - minn\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["3","1 2 3"],["6"]],[["5","999999999 999999999 999999999 999999999 999999999"],["3999999996"]],[["1","1"],["0"]],[["15","39 52 88 78 46 95 84 98 55 3 68 42 6 18 98"],["870"]],[["15","59 96 34 48 8 72 67 90 15 85 7 90 97 47 25"],["840"]],[["15","87 37 91 29 58 45 51 74 70 71 47 38 91 89 44"],["922"]],[["15","11 81 49 7 11 14 30 67 29 50 90 81 77 18 59"],["674"]],[["15","39 21 95 89 73 90 9 55 85 32 30 21 68 59 82"],["848"]],[["15","59 70 48 54 26 67 84 39 40 18 77 69 70 88 93"],["902"]],[["15","87 22 98 32 88 36 72 31 100 97 17 16 60 22 20"],["798"]],[["15","15 63 51 13 37 9 43 19 55 79 57 60 50 59 31"],["632"]],[["1","4"],["4"]],[["2","1 4"],["4"]],[["3","1 2 4"],["6"]],[["2","9 3"],["12"]],[["2","1000000000 1001"],["1000000000"]],[["3","1 8 4"],["12"]],[["3","7 4 4"],["8"]],[["5","2 3 4 5 3"],["14"]],[["2","4 5"],["4"]],[["3","2 4 5"],["6"]],[["3","2 2 3"],["4"]],[["2","2 3"],["2"]],[["4","2 3 7 7"],["16"]],[["2","999999999 2"],["2"]],[["2","2 5"],["2"]],[["3","5 3 1"],["8"]],[["4","3 2 5 7"],["14"]]]}} +{"instance_id":"pseudo_to_code_0.5k_135","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let n be a integer\n read n\n the integer value of x = 0\n the integer value of k = -1\n the integer value of m = 0\n for i = 1 to n inclusive\n for j = 1 to n + 1 inclusive\n m is equal to 0\n if j is equal to n + 1\n print newline\n stop\n end of the block\n for integer k = n \/ 2 - x + 1 to n \/ 2 + x + 1 inclusive\n if j is equal to k , increment m by 1\n end of the block\n if m is equal to 0\n print *\n else do the following\n print D\n end of the block\n end of the block\n if i <= n \/ 2\n increment x by 1\n else do the following\n decrement x by 1\n end of the block\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n int x = 0;\n int k = -1;\n int m = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n + 1; j++) {\n m = 0;\n if (j == n + 1) {\n cout << endl;\n break;\n }\n for (int k = n \/ 2 - x + 1; k <= n \/ 2 + x + 1; k++) {\n if (j == k) { m++; }\n }\n if (m == 0) {\n cout << '*';\n } else {\n cout << 'D';\n }\n }\n if (i <= n \/ 2) {\n x += 1;\n } else {\n x -= 1;\n }\n }\n return 0;\n}","item":{"problem_id":"454A","pseudocode":"define the main function\n let n be a integer\n read n\n the integer value of x = 0\n the integer value of k = -1\n the integer value of m = 0\n for i = 1 to n inclusive\n for j = 1 to n + 1 inclusive\n m is equal to 0\n if j is equal to n + 1\n print newline\n stop\n end of the block\n for integer k = n \/ 2 - x + 1 to n \/ 2 + x + 1 inclusive\n if j is equal to k , increment m by 1\n end of the block\n if m is equal to 0\n print *\n else do the following\n print D\n end of the block\n end of the block\n if i <= n \/ 2\n increment x by 1\n else do the following\n decrement x by 1\n end of the block\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["3"],["*D*","DDD","*D*"]],[["5"],["**D**","*DDD*","DDDDD","*DDD*","**D**"]],[["7"],["***D***","**DDD**","*DDDDD*","DDDDDDD","*DDDDD*","**DDD**","***D***"]],[["11"],["*****D*****","****DDD****","***DDDDD***","**DDDDDDD**","*DDDDDDDDD*","DDDDDDDDDDD","*DDDDDDDDD*","**DDDDDDD**","***DDDDD***","****DDD****","*****D*****"]],[["15"],["*******D*******","******DDD******","*****DDDDD*****","****DDDDDDD****","***DDDDDDDDD***","**DDDDDDDDDDD**","*DDDDDDDDDDDDD*","DDDDDDDDDDDDDDD","*DDDDDDDDDDDDD*","**DDDDDDDDDDD**","***DDDDDDDDD***","****DDDDDDD****","*****DDDDD*****","******DDD******","*******D*******"]],[["21"],["**********D**********","*********DDD*********","********DDDDD********","*******DDDDDDD*******","******DDDDDDDDD******","*****DDDDDDDDDDD*****","****DDDDDDDDDDDDD****","***DDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDD***","****DDDDDDDDDDDDD****","*****DDDDDDDDDDD*****","******DDDDDDDDD******","*******DDDDDDD*******","********DDDDD********","*********DDD*********","**********D**********"]],[["27"],["*************D*************","************DDD************","***********DDDDD***********","**********DDDDDDD**********","*********DDDDDDDDD*********","********DDDDDDDDDDD********","*******DDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDD*******","********DDDDDDDDDDD********","*********DDDDDDDDD*********","**********DDDDDDD**********","***********DDDDD***********","************DDD************","*************D*************"]],[["35"],["*****************D*****************","****************DDD****************","***************DDDDD***************","**************DDDDDDD**************","*************DDDDDDDDD*************","************DDDDDDDDDDD************","***********DDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDD***********","************DDDDDDDDDDD************","*************DDDDDDDDD*************","**************DDDDDDD**************","***************DDDDD***************","****************DDD****************","*****************D*****************"]],[["49"],["************************D************************","***********************DDD***********************","**********************DDDDD**********************","*********************DDDDDDD*********************","********************DDDDDDDDD********************","*******************DDDDDDDDDDD*******************","******************DDDDDDDDDDDDD******************","*****************DDDDDDDDDDDDDDD*****************","****************DDDDDDDDDDDDDDDDD****************","***************DDDDDDDDDDDDDDDDDDD***************","**************DDDDDDDDDDDDDDDDDDDDD**************","*************DDDDDDDDDDDDDDDDDDDDDDD*************","************DDDDDDDDDDDDDDDDDDDDDDDDD************","***********DDDDDDDDDDDDDDDDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDDDDDDDDDDDDDDDD***********","************DDDDDDDDDDDDDDDDDDDDDDDDD************","*************DDDDDDDDDDDDDDDDDDDDDDD*************","**************DDDDDDDDDDDDDDDDDDDDD**************","***************DDDDDDDDDDDDDDDDDDD***************","****************DDDDDDDDDDDDDDDDD****************","*****************DDDDDDDDDDDDDDD*****************","******************DDDDDDDDDDDDD******************","*******************DDDDDDDDDDD*******************","********************DDDDDDDDD********************","*********************DDDDDDD*********************","**********************DDDDD**********************","***********************DDD***********************","************************D************************"]],[["51"],["*************************D*************************","************************DDD************************","***********************DDDDD***********************","**********************DDDDDDD**********************","*********************DDDDDDDDD*********************","********************DDDDDDDDDDD********************","*******************DDDDDDDDDDDDD*******************","******************DDDDDDDDDDDDDDD******************","*****************DDDDDDDDDDDDDDDDD*****************","****************DDDDDDDDDDDDDDDDDDD****************","***************DDDDDDDDDDDDDDDDDDDDD***************","**************DDDDDDDDDDDDDDDDDDDDDDD**************","*************DDDDDDDDDDDDDDDDDDDDDDDDD*************","************DDDDDDDDDDDDDDDDDDDDDDDDDDD************","***********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***********","************DDDDDDDDDDDDDDDDDDDDDDDDDDD************","*************DDDDDDDDDDDDDDDDDDDDDDDDD*************","**************DDDDDDDDDDDDDDDDDDDDDDD**************","***************DDDDDDDDDDDDDDDDDDDDD***************","****************DDDDDDDDDDDDDDDDDDD****************","*****************DDDDDDDDDDDDDDDDD*****************","******************DDDDDDDDDDDDDDD******************","*******************DDDDDDDDDDDDD*******************","********************DDDDDDDDDDD********************","*********************DDDDDDDDD*********************","**********************DDDDDDD**********************","***********************DDDDD***********************","************************DDD************************","*************************D*************************"]]]}} +{"instance_id":"pseudo_to_code_0.5k_136","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create int n\n read n\n create int j = n + 1\n create int ans = max of 1 and (n * sqrt(2)) * 4 cast to int\n print ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n int j = n + 1;\n int ans = max(1, (int)(n * sqrt(2)) * 4);\n cout << ans << endl;\n return 0;\n}","item":{"problem_id":"392A","pseudocode":"define the main function\n create int n\n read n\n create int j = n + 1\n create int ans = max of 1 and (n * sqrt(2)) * 4 cast to int\n print ans\n return to indicate successful execution\nend of the block","testcases":[[["1"],["4"]],[["2"],["8"]],[["3"],["16"]],[["4"],["20"]],[["0"],["1"]],[["30426905"],["172120564"]],[["38450759"],["217510336"]],[["743404"],["4205328"]],[["3766137"],["21304488"]],[["19863843"],["112366864"]],[["24562258"],["138945112"]],[["24483528"],["138499748"]],[["25329968"],["143287936"]],[["31975828"],["180882596"]],[["2346673"],["13274784"]],[["17082858"],["96635236"]],[["22578061"],["127720800"]],[["17464436"],["98793768"]],[["18855321"],["106661800"]],[["614109"],["3473924"]],[["3107977"],["17581372"]],[["39268638"],["222136960"]],[["31416948"],["177721092"]],[["34609610"],["195781516"]],[["17590047"],["99504332"]],[["12823666"],["72541608"]],[["34714265"],["196373536"]],[["2870141"],["16235968"]],[["15012490"],["84923464"]],[["31988776"],["180955840"]],[["1059264"],["5992100"]],[["5626785"],["31829900"]],[["33146037"],["187502300"]],[["17"],["96"]],[["40000000"],["226274168"]],[["5"],["28"]],[["6"],["32"]],[["7"],["36"]],[["8"],["44"]],[["9"],["48"]],[["10"],["56"]],[["11"],["60"]],[["12"],["64"]],[["13"],["72"]],[["14"],["76"]],[["15"],["84"]],[["16"],["88"]],[["25"],["140"]],[["39999999"],["226274164"]],[["39999998"],["226274156"]],[["39999997"],["226274152"]],[["39999996"],["226274144"]],[["39099999"],["221182992"]],[["46340"],["262136"]],[["46341"],["262144"]],[["395938"],["2239760"]]]}} +{"instance_id":"pseudo_to_code_0.5k_137","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, s = int\n read n, s\n a = int array of length 110\n hh, mm = int\n tt = 0 = int\n for i = 0 to n exclusive, read hh and mm, a[i] = hh * 60 + mm\n flag = int = 1\n if s + 1 <= a[0] and flag then set both tt and flag to 0\n for i = 1 to n exclusive\n if s + 1 <= (a[i] - a[i - 1] - s - 1) and flag then set tt to a[i-1] + s + 1, set flag to 0\n end of the block\n if flag then set tt to a[n-1] + s + 1\n h = tt\/60 = int\n m = tt - tt\/60 * 60\n print h and space and m\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, s;\n cin >> n >> s;\n int a[110];\n int hh, mm;\n int tt = 0;\n for (int i = 0; i < n; i++) cin >> hh >> mm, a[i] = hh * 60 + mm;\n int flag = 1;\n if (s + 1 <= a[0] && flag) tt = 0, flag = 0;\n for (int i = 1; i < n; i++) {\n if (s + 1 <= (a[i] - a[i - 1] - s - 1) && flag) tt = a[i - 1] + s + 1, flag = 0;\n }\n if (flag) tt = a[n - 1] + s + 1;\n int h = tt \/ 60;\n int m = tt - tt \/ 60 * 60;\n cout << h << \" \" << m << endl;\n return 0;\n}","item":{"problem_id":"967A","pseudocode":"define the main function\n n, s = int\n read n, s\n a = int array of length 110\n hh, mm = int\n tt = 0 = int\n for i = 0 to n exclusive, read hh and mm, a[i] = hh * 60 + mm\n flag = int = 1\n if s + 1 <= a[0] and flag then set both tt and flag to 0\n for i = 1 to n exclusive\n if s + 1 <= (a[i] - a[i - 1] - s - 1) and flag then set tt to a[i-1] + s + 1, set flag to 0\n end of the block\n if flag then set tt to a[n-1] + s + 1\n h = tt\/60 = int\n m = tt - tt\/60 * 60\n print h and space and m\n return to indicate successful execution\nend of the block","testcases":[[["6 60","0 0","1 20","3 21","5 0","19 30","23 40"],["6 1"]],[["16 50","0 30","1 20","3 0","4 30","6 10","7 50","9 30","11 10","12 50","14 30","16 10","17 50","19 30","21 10","22 50","23 59"],["24 50"]],[["3 17","0 30","1 0","12 0"],["0 0"]],[["24 60","0 21","2 21","2 46","3 17","4 15","5 43","6 41","7 50","8 21","9 8","10 31","10 45","12 30","14 8","14 29","14 32","14 52","15 16","16 7","16 52","18 44","20 25","21 13","22 7"],["23 8"]],[["20 60","0 9","0 19","0 57","2 42","3 46","3 47","5 46","8 1","9 28","9 41","10 54","12 52","13 0","14 49","17 28","17 39","19 34","20 52","21 35","23 22"],["6 47"]],[["57 20","0 2","0 31","1 9","1 42","1 58","2 4","2 35","2 49","3 20","3 46","4 23","4 52","5 5","5 39","6 7","6 48","6 59","7 8","7 35","8 10","8 46","8 53","9 19","9 33","9 43","10 18","10 42","11 0","11 26","12 3","12 5","12 30","13 1","13 38","14 13","14 54","15 31","16 5","16 44","17 18","17 30","17 58","18 10","18 34","19 13","19 49","19 50","19 59","20 17","20 23","20 40","21 18","21 57","22 31","22 42","22 56","23 37"],["23 58"]],[["66 20","0 16","0 45","0 58","1 6","1 19","2 7","2 9","3 9","3 25","3 57","4 38","4 58","5 21","5 40","6 16","6 19","6 58","7 6","7 26","7 51","8 13","8 36","8 55","9 1","9 15","9 33","10 12","10 37","11 15","11 34","12 8","12 37","12 55","13 26","14 0","14 34","14 36","14 48","15 23","15 29","15 43","16 8","16 41","16 45","17 5","17 7","17 15","17 29","17 46","18 12","18 19","18 38","18 57","19 32","19 58","20 5","20 40","20 44","20 50","21 18","21 49","22 18","22 47","23 1","23 38","23 50"],["1 40"]],[["1 1","0 0"],["0 2"]],[["10 1","0 2","0 4","0 5","0 8","0 9","0 11","0 13","0 16","0 19","0 21"],["0 0"]],[["10 1","0 2","0 5","0 8","0 11","0 15","0 17","0 25","0 28","0 29","0 32"],["0 0"]],[["15 20","0 47","2 24","4 19","4 34","5 46","8 15","9 8","10 28","17 47","17 52","18 32","19 50","20 46","20 50","23 21"],["0 0"]],[["1 5","1 0"],["0 0"]],[["24 60","1 0","2 0","3 0","4 0","5 0","6 0","7 0","8 0","9 0","10 0","11 0","12 0","13 0","14 0","15 0","16 0","17 0","18 0","19 0","20 0","21 0","22 0","23 0","23 59"],["25 0"]],[["1 30","0 29"],["1 0"]],[["1 2","3 0"],["0 0"]],[["16 60","0 30","1 20","3 0","4 30","6 10","7 50","9 30","11 10","12 50","14 30","16 10","17 50","19 30","21 10","22 50","23 59"],["25 0"]],[["1 5","0 6"],["0 0"]],[["2 60","0 59","23 59"],["2 0"]],[["1 58","0 1"],["1 0"]],[["25 60","0 0","1 0","2 0","3 0","4 0","5 0","6 0","7 0","8 0","9 0","10 0","11 0","12 0","13 0","14 0","15 0","16 0","17 0","18 0","19 0","20 0","21 0","22 0","23 0","23 59"],["25 0"]],[["2 3","0 3","0 30"],["0 7"]],[["16 50","0 30","1 20","3 0","4 30","6 10","7 50","9 30","11 10","12 50","14 30","16 10","17 50","19 30","21 10","22 50","23 9"],["24 0"]],[["1 60","2 0"],["0 0"]],[["2 60","0 0","5 0"],["1 1"]],[["1 30","0 31"],["0 0"]],[["2 60","0 59","3 1"],["2 0"]],[["2 60","0 59","5 0"],["2 0"]],[["1 59","0 0"],["1 0"]],[["3 25","0 0","1 0","2 0"],["0 26"]],[["1 2","2 3"],["0 0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_138","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate integers n, s, create integer array a with size 50\ndefine the main function\n read n\n for i = 1 to n inclusive\n read s\n increment a[s]\n end of the block\n if a[1] is greater than a[2]\n print a[2] + ( a[1] - a[2] ) \/ 3 print newline\n else\n print a[1] print newline\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int n, a[50], s;\nint main() {\n cin >> n;\n for (int i = 1; i <= n; i++) {\n cin >> s;\n a[s]++;\n }\n if (a[1] > a[2]) {\n cout << a[2] + (a[1] - a[2]) \/ 3 << endl;\n } else {\n cout << a[1] << endl;\n }\n return 0;\n}","item":{"problem_id":"899A","pseudocode":"create integers n, s, create integer array a with size 50\ndefine the main function\n read n\n for i = 1 to n inclusive\n read s\n increment a[s]\n end of the block\n if a[1] is greater than a[2]\n print a[2] + ( a[1] - a[2] ) \/ 3 print newline\n else\n print a[1] print newline\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["4","1 1 2 1"],["1"]],[["2","2 2"],["0"]],[["7","2 2 2 1 1 1 1"],["3"]],[["3","1 1 1"],["1"]],[["3","2 2 2"],["0"]],[["3","1 2 1"],["1"]],[["5","2 2 1 1 1"],["2"]],[["7","1 1 2 2 1 2 1"],["3"]],[["10","1 2 2 1 2 2 1 2 1 1"],["5"]],[["5","2 2 2 1 2"],["1"]],[["43","1 2 2 2 1 1 2 2 1 1 2 2 2 2 1 2 2 2 2 2 1 2 1 2 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2"],["10"]],[["72","1 2 1 2 2 1 2 1 1 1 1 2 2 1 2 1 2 1 2 2 2 2 1 2 2 2 2 1 2 1 1 2 2 1 1 2 2 2 2 2 1 1 1 1 2 2 1 1 2 1 1 1 1 2 2 1 2 2 1 2 1 1 2 1 2 2 1 1 1 2 2 2"],["34"]],[["64","2 2 1 1 1 2 1 1 1 2 2 1 2 2 2 1 2 2 2 1 1 1 1 2 1 2 1 2 1 1 2 2 1 1 2 2 1 1 1 1 2 2 1 1 1 2 1 2 2 2 2 2 2 2 1 1 2 1 1 1 2 2 1 2"],["32"]],[["20","1 1 1 1 2 1 2 2 2 1 2 1 2 1 2 1 1 2 1 2"],["9"]],[["23","1 1 1 1 2 1 2 1 1 1 2 2 2 2 2 2 1 2 1 2 2 1 1"],["11"]],[["201","1 1 2 2 2 2 1 1 1 2 2 1 2 1 2 1 2 2 2 1 1 2 1 1 1 2 1 2 1 1 1 2 1 1 2 1 2 2 1 1 1 1 2 1 1 2 1 1 1 2 2 2 2 1 2 1 2 2 2 2 2 2 1 1 1 2 2 1 1 1 1 2 2 1 2 1 1 2 2 1 1 2 2 2 1 1 1 2 1 1 2 1 2 2 1 2 2 2 2 1 1 1 2 1 2 2 2 2 2 1 2 1 1 1 2 2 2 2 2 1 2 1 1 2 2 2 1 1 2 2 1 2 2 2 1 1 1 2 1 1 1 2 1 1 2 2 2 1 2 1 1 1 2 2 1 1 2 2 2 2 2 2 1 2 2 1 2 2 2 1 1 2 2 1 1 2 1 1 1 1 2 1 1 1 2 2 1 2 1 1 2 2 1 1 2 1 2 1 1 1 2"],["100"]],[["247","2 2 1 2 1 2 2 2 2 2 2 1 1 2 2 1 2 1 1 1 2 1 1 1 1 2 1 1 2 2 1 2 1 1 1 2 2 2 1 1 2 1 1 2 1 1 1 2 1 2 1 2 2 1 1 2 1 2 2 1 2 1 2 1 1 2 1 1 1 2 2 1 1 2 2 1 1 2 1 1 1 2 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 1 1 1 1 1 1 1 1 1 2 1 2 2 1 2 1 2 2 2 1 2 2 2 1 1 2 2 1 1 1 2 1 1 1 1 2 2 1 2 2 1 1 1 2 1 2 2 1 2 1 1 1 2 2 2 2 2 1 2 2 2 1 1 1 2 1 2 1 1 2 2 2 2 1 1 2 2 2 1 2 2 2 1 2 1 1 2 2 2 2 1 2 2 1 1 1 2 1 2 1 1 1 2 2 1 1 2 1 1 2 1 2 1 1 2 1 1 1 1 2 1 1 1 1 2 2 1 2 1 1 2 1 2 2 1 2 2 2 1 2 2 1 2 2 1 1 1 2 2 2"],["123"]],[["4","2 2 2 2"],["0"]],[["4","1 1 1 1"],["1"]],[["2","1 1"],["0"]],[["2","2 1"],["1"]],[["2","1 2"],["1"]],[["3","1 1 2"],["1"]],[["3","1 2 2"],["1"]],[["3","2 1 1"],["1"]],[["3","2 1 2"],["1"]],[["3","2 2 1"],["1"]],[["4","1 1 1 2"],["1"]],[["4","1 1 2 2"],["2"]],[["4","1 2 2 2"],["1"]],[["4","2 1 1 1"],["1"]],[["5","1 1 1 1 2"],["2"]],[["14","1 2 2 2 2 2 2 2 2 2 2 2 2 2"],["1"]],[["38","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1"],["1"]],[["30","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1"],["1"]],[["20","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1"],["1"]],[["26","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2"],["1"]],[["6","1 1 1 2 2 2"],["3"]],[["5","2 1 1 1 1"],["2"]],[["9","1 1 1 1 1 1 2 2 2"],["4"]],[["10","2 2 1 1 1 1 1 1 1 1"],["4"]],[["6","1 1 1 1 1 1"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_139","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nin the function gcd that takes integer a, b and returns integer\n return if b, gcd(b, a % b) else a\nend of the block\nin the function lcm that takes integer a, b and returns integer\n return a \/ gcd(a, b) * b\nend of the block\nin the function lcm that takes integer pointer arr and integer n and returns integer\n r = integer with r = arr[0]\n for i = 1 to n exclusive, r = lcm of r and arr[i]\n return r\nend of the block\nin = bool array of size 101 with in= {}\ncycle = integer array of size 101\ntarget = integer array of size 101\nn = integer\ndefine the main function\n read n\n for i = 1 to n\n read target[i]\n if in[target[i]]\n print -1\n return to indicate successful execution\n end of the block\n in[target[i]] = true\n end of the block\n for i = 1 to n\n current = integer with current = i\n cycle[i] = 0\n do\n current = target[current]\n cycle[i] = cycle[i] + cycle[i] 1\n while current is not i\n if ((cycle[i] bitwise and 1) is 0), cycle[i] = right shift cycle[i] 1 place\n end of the block\n print lcm(cycle + 1, n)\nend of the block\n\n[CODE]:","reference_output":"int gcd(int a, int b) {\n return b ? gcd(b, a % b) : a;\n}\nint lcm(int a, int b) {\n return a \/ gcd(a, b) * b;\n}\nint lcm(int *arr, int n) {\n int r = arr[0];\n for (int i = 1; i < n; ++i) { r = lcm(r, arr[i]); }\n return r;\n}\nbool in[101] = {};\nint cycle[101];\nint target[101];\nint n;\nint main() {\n cin >> n;\n for (int i = 1; i <= n; ++i) {\n cin >> target[i];\n if (in[target[i]]) {\n cout << -1 << endl;\n return 0;\n }\n in[target[i]] = true;\n }\n for (int i = 1; i <= n; ++i) {\n int current = i;\n cycle[i] = 0;\n do {\n current = target[current];\n cycle[i] += 1;\n } while (current != i);\n if ((cycle[i] & 1) == 0) { cycle[i] >>= 1; }\n }\n cout << lcm(cycle + 1, n) << endl;\n}","item":{"problem_id":"741A","pseudocode":"in the function gcd that takes integer a, b and returns integer\n return if b, gcd(b, a % b) else a\nend of the block\nin the function lcm that takes integer a, b and returns integer\n return a \/ gcd(a, b) * b\nend of the block\nin the function lcm that takes integer pointer arr and integer n and returns integer\n r = integer with r = arr[0]\n for i = 1 to n exclusive, r = lcm of r and arr[i]\n return r\nend of the block\nin = bool array of size 101 with in= {}\ncycle = integer array of size 101\ntarget = integer array of size 101\nn = integer\ndefine the main function\n read n\n for i = 1 to n\n read target[i]\n if in[target[i]]\n print -1\n return to indicate successful execution\n end of the block\n in[target[i]] = true\n end of the block\n for i = 1 to n\n current = integer with current = i\n cycle[i] = 0\n do\n current = target[current]\n cycle[i] = cycle[i] + cycle[i] 1\n while current is not i\n if ((cycle[i] bitwise and 1) is 0), cycle[i] = right shift cycle[i] 1 place\n end of the block\n print lcm(cycle + 1, n)\nend of the block","testcases":[[["4","2 3 1 4"],["3"]],[["4","4 4 4 4"],["-1"]],[["4","2 1 4 3"],["1"]],[["5","2 4 3 1 2"],["-1"]],[["5","2 2 4 4 5"],["-1"]],[["5","2 4 5 4 2"],["-1"]],[["10","8 10 4 3 2 1 9 6 5 7"],["15"]],[["10","10 1 4 8 5 2 3 7 9 6"],["2"]],[["10","6 4 3 9 5 2 1 10 8 7"],["4"]],[["100","1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100"],["1"]],[["100","95 27 13 62 100 21 48 84 27 41 34 89 21 96 56 10 6 27 9 85 7 85 16 12 80 78 20 79 63 1 74 46 56 59 62 88 59 5 42 13 81 58 49 1 62 51 2 75 92 94 14 32 31 39 34 93 72 18 59 44 11 75 27 36 44 72 63 55 41 63 87 59 54 81 68 39 95 96 99 50 94 5 3 84 59 95 71 44 35 51 73 54 49 98 44 11 52 74 95 48"],["-1"]],[["100","70 49 88 43 66 72 6 6 48 46 59 22 56 86 14 53 50 84 79 76 89 65 10 14 27 43 92 95 98 6 86 6 95 65 91 8 58 33 31 67 75 65 94 75 12 25 37 56 17 79 74 5 94 65 99 75 16 52 19 17 41 39 44 46 51 50 82 90 25 32 83 36 74 49 61 37 8 52 35 28 58 82 76 12 7 66 23 85 53 19 45 8 46 21 62 38 42 48 100 61"],["-1"]],[["100","27 55 94 11 56 59 83 81 79 89 48 89 7 75 70 20 70 76 14 81 61 55 98 76 35 20 79 100 77 12 97 57 16 80 45 75 2 21 44 81 93 75 69 3 87 25 27 25 85 91 96 86 35 85 99 61 70 37 11 27 63 89 62 47 61 10 91 13 90 18 72 47 47 98 93 27 71 37 51 31 80 63 42 88 6 76 11 12 13 7 90 99 100 27 22 66 41 49 12 11"],["-1"]],[["100","98 39 44 79 31 99 96 72 97 54 83 15 81 65 59 75 3 51 83 40 28 54 41 93 56 94 93 58 20 53 21 7 81 17 71 31 31 88 34 22 55 67 57 92 34 88 87 23 36 33 41 33 17 10 71 28 79 6 3 60 67 99 68 8 39 29 49 17 82 43 100 86 64 47 55 66 58 57 50 49 8 11 15 91 42 44 72 28 18 32 81 22 20 78 55 51 37 94 34 4"],["-1"]],[["100","53 12 13 98 57 83 52 61 69 54 13 92 91 27 16 91 86 75 93 29 16 59 14 2 37 74 34 30 98 17 3 72 83 93 21 72 52 89 57 58 60 29 94 16 45 20 76 64 78 67 76 68 41 47 50 36 9 75 79 11 10 88 71 22 36 60 44 19 79 43 49 24 6 57 8 42 51 58 60 2 84 48 79 55 74 41 89 10 45 70 76 29 53 9 82 93 24 40 94 56"],["-1"]],[["100","33 44 16 91 71 86 84 45 12 97 18 1 42 67 89 45 62 56 72 70 59 62 96 13 24 19 81 61 99 65 12 26 59 61 6 19 71 49 52 17 56 6 8 98 75 83 39 75 45 8 98 35 25 3 51 89 82 50 82 30 74 63 77 60 23 36 55 49 74 73 66 62 100 44 26 72 24 84 100 54 87 65 87 61 54 29 38 99 91 63 47 44 28 11 14 29 51 55 28 95"],["-1"]],[["100","17 14 81 16 30 51 62 47 3 42 71 63 45 67 91 20 35 45 15 94 83 89 7 32 49 68 73 14 94 45 64 64 15 56 46 32 92 92 10 32 58 86 15 17 41 59 95 69 71 74 92 90 82 64 59 93 74 58 84 21 61 51 47 1 93 91 47 61 13 53 97 65 80 78 41 1 89 4 21 27 45 28 21 96 29 96 49 75 41 46 6 33 50 31 30 3 21 8 34 7"],["-1"]],[["100","42 40 91 4 21 49 59 37 1 62 23 2 32 88 48 39 35 50 67 11 20 19 63 98 63 20 63 95 25 82 34 55 6 93 65 40 62 84 84 47 79 22 5 51 5 16 63 43 57 81 76 44 19 61 68 80 47 30 32 72 72 26 76 12 37 2 70 14 86 77 48 26 89 87 25 8 74 18 13 8 1 45 37 10 96 100 80 48 59 73 8 67 18 66 10 26 3 65 22 8"],["-1"]],[["100","49 94 43 50 70 25 37 19 66 89 98 83 57 98 100 61 89 56 75 61 2 14 28 14 60 84 82 89 100 25 57 80 51 37 74 40 90 68 24 56 17 86 87 83 52 65 7 18 5 2 53 79 83 56 55 35 29 79 46 97 25 10 47 1 61 74 4 71 34 85 39 17 7 84 22 80 38 60 89 83 80 81 87 11 41 15 57 53 45 75 58 51 85 12 93 8 90 3 1 59"],["-1"]],[["100","84 94 72 32 61 90 61 2 76 42 35 82 90 29 51 27 65 99 38 41 44 73 100 58 56 64 54 31 14 58 57 64 90 49 73 80 74 19 31 86 73 44 39 43 28 95 23 5 85 5 74 81 34 44 86 30 50 57 94 56 53 42 53 87 92 78 53 49 78 60 37 63 41 19 15 68 25 77 87 48 23 100 54 27 68 84 43 92 76 55 2 94 100 20 92 18 76 83 100 99"],["-1"]],[["100","82 62 73 22 56 69 88 72 76 99 13 30 64 21 89 37 5 7 16 38 42 96 41 6 34 18 35 8 31 92 63 87 58 75 9 53 80 46 33 100 68 36 24 3 77 45 2 51 78 54 67 48 15 1 79 57 71 97 17 52 4 98 85 14 47 83 84 49 27 91 19 29 25 44 11 43 60 86 61 94 32 10 59 93 65 20 50 55 66 95 90 70 39 26 12 74 40 81 23 28"],["1260"]],[["100","23 12 62 61 32 22 34 91 49 44 59 26 7 89 98 100 60 21 30 9 68 97 33 71 67 83 45 38 5 8 2 65 16 69 18 82 72 27 78 73 35 48 29 36 66 54 95 37 10 19 20 77 1 17 87 70 42 4 50 53 63 94 93 56 24 88 55 6 11 58 39 75 90 40 57 79 47 31 41 51 52 85 14 13 99 64 25 46 15 92 28 86 43 76 84 96 3 74 81 80"],["6864"]],[["100","88 41 92 79 21 91 44 2 27 96 9 64 73 87 45 13 39 43 16 42 99 54 95 5 75 1 48 4 15 47 34 71 76 62 17 70 81 80 53 90 67 3 38 58 32 25 29 63 6 50 51 14 37 97 24 52 65 40 31 98 100 77 8 33 61 11 49 84 89 78 56 20 94 35 86 46 85 36 82 93 7 59 10 60 69 57 12 74 28 22 30 66 18 68 72 19 26 83 23 55"],["360"]],[["100","37 60 72 43 66 70 13 6 27 41 36 52 44 92 89 88 64 90 77 32 78 58 35 31 97 50 95 82 7 65 99 22 16 28 85 46 26 38 15 79 34 96 23 39 42 75 51 83 33 57 3 53 4 48 18 8 98 24 55 84 20 30 14 25 40 29 91 69 68 17 54 94 74 49 73 11 62 81 59 86 61 45 19 80 76 67 21 2 71 87 10 1 63 9 100 93 47 56 5 12"],["1098"]],[["100","79 95 49 70 84 28 89 18 5 3 57 30 27 19 41 46 12 88 2 75 58 44 31 16 8 83 87 68 90 29 67 13 34 17 1 72 80 15 20 4 22 37 92 7 98 96 69 76 45 91 82 60 93 78 86 39 21 94 77 26 14 59 24 56 35 71 52 38 48 100 32 74 9 54 47 63 23 55 51 81 53 33 6 36 62 11 42 73 43 99 50 97 61 85 66 65 25 10 64 40"],["13090"]],[["100","74 71 86 6 75 16 62 25 95 45 29 36 97 5 8 78 26 69 56 57 60 15 55 87 14 23 68 11 31 47 3 24 7 54 49 80 33 76 30 65 4 53 93 20 37 84 35 1 66 40 46 17 12 73 42 96 38 2 32 72 58 51 90 22 99 89 88 21 85 28 63 10 92 18 61 98 27 19 81 48 34 94 50 83 59 77 9 44 79 43 39 100 82 52 70 41 67 13 64 91"],["4020"]],[["100","58 65 42 100 48 22 62 16 20 2 19 8 60 28 41 90 39 31 74 99 34 75 38 82 79 29 24 84 6 95 49 43 94 81 51 44 77 72 1 55 47 69 15 33 66 9 53 89 97 67 4 71 57 18 36 88 83 91 5 61 40 70 10 23 26 30 59 25 68 86 85 12 96 46 87 14 32 11 93 27 54 37 78 92 52 21 80 13 50 17 56 35 73 98 63 3 7 45 64 76"],["1098"]],[["100","60 68 76 27 73 9 6 10 1 46 3 34 75 11 33 89 59 16 21 50 82 86 28 95 71 31 58 69 20 42 91 79 18 100 8 36 92 25 61 22 45 39 23 66 32 65 80 51 67 84 35 43 98 2 97 4 13 81 24 19 70 7 90 37 62 48 41 94 40 56 93 44 47 83 15 17 74 88 64 30 77 5 26 29 57 12 63 14 38 87 99 52 78 49 96 54 55 53 85 72"],["132"]],[["100","72 39 12 50 13 55 4 94 22 61 33 14 29 93 28 53 59 97 2 24 6 98 52 21 62 84 44 41 78 82 71 89 88 63 57 42 67 16 30 1 27 66 35 26 36 90 95 65 7 48 47 11 34 76 69 3 100 60 32 45 40 87 18 81 51 56 73 85 25 31 8 77 37 58 91 20 83 92 38 17 9 64 43 5 10 99 46 23 75 74 80 68 15 19 70 86 79 54 49 96"],["4620"]],[["100","91 50 1 37 65 78 73 10 68 84 54 41 80 59 2 96 53 5 19 58 82 3 88 34 100 76 28 8 44 38 17 15 63 94 21 72 57 31 33 40 49 56 6 52 95 66 71 20 12 16 35 75 70 39 4 60 45 9 89 18 87 92 85 46 23 79 22 24 36 81 25 43 11 86 67 27 32 69 77 26 42 98 97 93 51 61 48 47 62 90 74 64 83 30 14 55 13 29 99 7"],["3498"]],[["100","40 86 93 77 68 5 32 77 1 79 68 33 29 36 38 3 69 46 72 7 27 27 30 40 21 18 69 69 32 10 82 97 1 34 87 81 92 67 47 3 52 89 25 41 88 79 5 46 41 82 87 1 77 41 54 16 6 92 18 10 37 45 71 25 16 66 39 94 60 13 48 64 28 91 80 36 4 53 50 28 30 45 92 79 93 71 96 66 65 73 57 71 48 78 76 53 96 76 81 89"],["-1"]],[["100","2 35 14 84 13 36 35 50 61 6 85 13 65 12 30 52 25 84 46 28 84 78 45 7 64 47 3 4 89 99 83 92 38 75 25 44 47 55 44 80 20 26 88 37 64 57 81 8 7 28 34 94 9 37 39 54 53 59 3 26 19 40 59 38 54 43 61 67 43 67 6 25 63 54 9 77 73 54 17 40 14 76 51 74 44 56 18 40 31 38 37 11 87 77 92 79 96 22 59 33"],["-1"]],[["100","68 45 33 49 40 52 43 60 71 83 43 47 6 34 5 94 99 74 65 78 31 52 51 72 8 12 70 87 39 68 2 82 90 71 82 44 43 34 50 26 59 62 90 9 52 52 81 5 72 27 71 95 32 6 23 27 26 63 66 3 35 58 62 87 45 16 64 82 62 40 22 15 88 21 50 58 15 49 45 99 78 8 81 55 90 91 32 86 29 30 50 74 96 43 43 6 46 88 59 12"],["-1"]],[["100","83 4 84 100 21 83 47 79 11 78 40 33 97 68 5 46 93 23 54 93 61 67 88 8 91 11 46 10 48 39 95 29 81 36 71 88 45 64 90 43 52 49 59 57 45 83 74 89 22 67 46 2 63 84 20 30 51 26 70 84 35 70 21 86 88 79 7 83 13 56 74 54 83 96 31 57 91 69 60 43 12 34 31 23 70 48 96 58 20 36 87 17 39 100 31 69 21 54 49 42"],["-1"]],[["100","35 12 51 32 59 98 65 84 34 83 75 72 35 31 17 55 35 84 6 46 23 74 81 98 61 9 39 40 6 15 44 79 98 3 45 41 64 56 4 27 62 27 68 80 99 21 32 26 60 82 5 1 98 75 49 26 60 25 57 18 69 88 51 64 74 97 81 78 62 32 68 77 48 71 70 64 17 1 77 25 95 68 33 80 11 55 18 42 24 73 51 55 82 72 53 20 99 15 34 54"],["-1"]],[["100","82 56 26 86 95 27 37 7 8 41 47 87 3 45 27 34 61 95 92 44 85 100 7 36 23 7 43 4 34 48 88 58 26 59 89 46 47 13 6 13 40 16 6 32 76 54 77 3 5 22 96 22 52 30 16 99 90 34 27 14 86 16 7 72 49 82 9 21 32 59 51 90 93 38 54 52 23 13 89 51 18 96 92 71 3 96 31 74 66 20 52 88 55 95 88 90 56 19 62 68"],["-1"]],[["100","58 40 98 67 44 23 88 8 63 52 95 42 28 93 6 24 21 12 94 41 95 65 38 77 17 41 94 99 84 8 5 10 90 48 18 7 72 16 91 82 100 30 73 41 15 70 13 23 39 56 15 74 42 69 10 86 21 91 81 15 86 72 56 19 15 48 28 38 81 96 7 8 90 44 13 99 99 9 70 26 95 95 77 83 78 97 2 74 2 76 97 27 65 68 29 20 97 91 58 28"],["-1"]],[["100","99 7 60 94 9 96 38 44 77 12 75 88 47 42 88 95 59 4 12 96 36 16 71 6 26 19 88 63 25 53 90 18 95 82 63 74 6 60 84 88 80 95 66 50 21 8 61 74 61 38 31 19 28 76 94 48 23 80 83 58 62 6 64 7 72 100 94 90 12 63 44 92 32 12 6 66 49 80 71 1 20 87 96 12 56 23 10 77 98 54 100 77 87 31 74 19 42 88 52 17"],["-1"]],[["100","36 66 56 95 69 49 32 50 93 81 18 6 1 4 78 49 2 1 87 54 78 70 22 26 95 22 30 54 93 65 74 79 48 3 74 21 88 81 98 89 15 80 18 47 27 52 93 97 57 38 38 70 55 26 21 79 43 30 63 25 98 8 18 9 94 36 86 43 24 96 78 43 54 67 32 84 14 75 37 68 18 30 50 37 78 1 98 19 37 84 9 43 4 95 14 38 73 4 78 39"],["-1"]],[["100","37 3 68 45 91 57 90 83 55 17 42 26 23 46 51 43 78 83 12 42 28 17 56 80 71 41 32 82 41 64 56 27 32 40 98 6 60 98 66 82 65 27 69 28 78 57 93 81 3 64 55 85 48 18 73 40 48 50 60 9 63 54 55 7 23 93 22 34 75 18 100 16 44 31 37 85 27 87 69 37 73 89 47 10 34 30 11 80 21 30 24 71 14 28 99 45 68 66 82 81"],["-1"]],[["100","98 62 49 47 84 1 77 88 76 85 21 50 2 92 72 66 100 99 78 58 33 83 27 89 71 97 64 94 4 13 17 8 32 20 79 44 12 56 7 9 43 6 26 57 18 23 39 69 30 55 16 96 35 91 11 68 67 31 38 90 40 48 25 41 54 82 15 22 37 51 81 65 60 34 24 14 5 87 74 19 46 3 80 45 61 86 10 28 52 73 29 42 70 53 93 95 63 75 59 36"],["42"]],[["100","57 60 40 66 86 52 88 4 54 31 71 19 37 16 73 95 98 77 92 59 35 90 24 96 10 45 51 43 91 63 1 80 14 82 21 29 2 74 99 8 79 76 56 44 93 17 12 33 87 46 72 83 36 49 69 22 3 38 15 13 34 20 42 48 25 28 18 9 50 32 67 84 62 97 68 5 27 65 30 6 81 26 39 41 55 11 70 23 7 53 64 85 100 58 78 75 94 47 89 61"],["353430"]],[["100","60 2 18 55 53 58 44 32 26 70 90 4 41 40 25 69 13 73 22 5 16 23 21 86 48 6 99 78 68 49 63 29 35 76 14 19 97 12 9 51 100 31 81 43 52 91 47 95 96 38 62 10 36 46 87 28 20 93 54 27 94 7 11 37 33 61 24 34 72 3 74 82 77 67 8 88 80 59 92 84 56 57 83 65 50 98 75 17 39 71 42 66 15 45 79 64 1 30 89 85"],["1235"]],[["100","9 13 6 72 98 70 5 100 26 75 25 87 35 10 95 31 41 80 91 38 61 64 29 71 52 63 24 74 14 56 92 85 12 73 59 23 3 39 30 42 68 47 16 18 8 93 96 67 48 89 53 77 49 62 44 33 83 57 81 55 28 76 34 36 88 37 17 11 40 90 46 84 94 60 4 51 69 21 50 82 97 1 54 2 65 32 15 22 79 27 99 78 20 43 7 86 45 19 66 58"],["2376"]],[["100","84 39 28 52 82 49 47 4 88 15 29 38 92 37 5 16 83 7 11 58 45 71 23 31 89 34 69 100 90 53 66 50 24 27 14 19 98 1 94 81 77 87 70 54 85 26 42 51 99 48 10 57 95 72 3 33 43 41 22 97 62 9 40 32 44 91 76 59 2 65 20 61 60 64 78 86 55 75 80 96 93 73 13 68 74 25 35 30 17 8 46 36 67 79 12 21 56 63 6 18"],["330"]],[["100","95 66 71 30 14 70 78 75 20 85 10 90 53 9 56 88 38 89 77 4 34 81 33 41 65 99 27 44 61 21 31 83 50 19 58 40 15 47 76 7 5 74 37 1 86 67 43 96 63 92 97 25 59 42 73 60 57 80 62 6 12 51 16 45 36 82 93 54 46 35 94 3 11 98 87 22 69 100 23 48 2 49 28 55 72 8 91 13 68 39 24 64 17 52 18 26 32 29 84 79"],["1071"]],[["100","73 21 39 30 78 79 15 46 18 60 2 1 45 35 74 26 43 49 96 59 89 61 34 50 42 84 16 41 92 31 100 64 25 27 44 98 86 47 29 71 97 11 95 62 48 66 20 53 22 83 76 32 77 63 54 99 87 36 9 70 17 52 72 38 81 19 23 65 82 37 24 10 91 93 56 12 88 58 51 33 4 28 8 3 40 7 67 69 68 6 80 13 5 55 14 85 94 75 90 57"],["7315"]],[["100","44 43 76 48 53 13 9 60 20 18 82 31 28 26 58 3 85 93 69 73 100 42 2 12 30 50 84 7 64 66 47 56 89 88 83 37 63 68 27 52 49 91 62 45 67 65 90 75 81 72 87 5 38 33 6 57 35 97 77 22 51 23 80 99 11 8 15 71 16 4 92 1 46 70 54 96 34 19 86 40 39 25 36 78 29 10 95 59 55 61 98 14 79 17 32 24 21 74 41 94"],["290"]],[["100","31 77 71 33 94 74 19 20 46 21 14 22 6 93 68 54 55 2 34 25 44 90 91 95 61 51 82 64 99 76 7 11 52 86 50 70 92 66 87 97 45 49 39 79 26 32 75 29 83 47 18 62 28 27 88 60 67 81 4 24 3 80 16 85 35 42 9 65 23 15 36 8 12 13 10 57 73 69 48 78 43 1 58 63 38 84 40 56 98 30 17 72 96 41 53 5 37 89 100 59"],["708"]],[["100","49 44 94 57 25 2 97 64 83 14 38 31 88 17 32 33 75 81 15 54 56 30 55 66 60 86 20 5 80 28 67 91 89 71 48 3 23 35 58 7 96 51 13 100 39 37 46 85 99 45 63 16 92 9 41 18 24 84 1 29 72 77 27 70 62 43 69 78 36 53 90 82 74 11 34 19 76 21 8 52 61 98 68 6 40 26 50 93 12 42 87 79 47 4 59 10 73 95 22 65"],["1440"]],[["100","81 59 48 7 57 38 19 4 31 33 74 66 9 67 95 91 17 26 23 44 88 35 76 5 2 11 32 41 13 21 80 73 75 22 72 87 65 3 52 61 25 86 43 55 99 62 53 34 85 63 60 71 10 27 29 47 24 42 15 40 16 96 6 45 54 93 8 70 92 12 83 77 64 90 56 28 20 97 36 46 1 49 14 100 68 50 51 98 79 89 78 37 39 82 58 69 30 94 84 18"],["87"]],[["100","62 50 16 53 19 18 63 26 47 85 59 39 54 92 95 35 71 69 29 94 98 68 37 75 61 25 88 73 36 89 46 67 96 12 58 41 64 45 34 32 28 74 15 43 66 97 70 90 42 13 56 93 52 21 60 20 17 79 49 5 72 83 23 51 2 77 65 55 11 76 91 81 100 44 30 8 4 10 7 99 31 87 82 86 14 9 40 78 22 48 80 38 57 33 24 6 1 3 27 84"],["777"]],[["100","33 66 80 63 41 88 39 48 86 68 76 81 59 99 93 100 43 37 11 64 91 22 7 57 87 58 72 60 35 79 18 94 70 25 69 31 3 27 53 30 29 54 83 36 56 55 84 34 51 73 90 95 92 85 47 44 97 5 10 12 65 61 40 98 17 23 1 82 16 50 74 28 24 4 2 52 67 46 78 13 89 77 6 15 8 62 45 32 21 75 19 14 71 49 26 38 20 42 96 9"],["175"]],[["100","66 48 77 30 76 54 64 37 20 40 27 21 89 90 23 55 53 22 81 97 28 63 45 14 38 44 59 6 34 78 10 69 75 79 72 42 99 68 29 83 62 33 26 17 46 35 80 74 50 1 85 16 4 56 43 57 88 5 19 51 73 9 94 47 8 18 91 52 86 98 12 32 3 60 100 36 96 49 24 13 67 25 65 93 95 87 61 92 71 82 31 41 84 70 39 58 7 2 15 11"],["5187"]],[["100","2 61 67 86 93 56 83 59 68 43 15 20 49 17 46 60 19 21 24 84 8 81 55 31 73 99 72 41 91 47 85 50 4 90 23 66 95 5 11 79 58 77 26 80 40 52 92 74 100 6 82 57 65 14 96 27 32 3 88 16 97 35 30 51 29 38 13 87 76 63 98 18 25 37 48 62 75 36 94 69 78 39 33 44 42 54 9 53 12 70 22 34 89 7 10 64 45 28 1 71"],["9765"]],[["100","84 90 51 80 67 7 43 77 9 72 97 59 44 40 47 14 65 42 35 8 85 56 53 32 58 48 62 29 96 92 18 5 60 98 27 69 25 33 83 30 82 46 87 76 70 73 55 21 31 99 50 13 16 34 81 89 22 10 61 78 4 36 41 19 68 64 17 74 28 11 94 52 6 24 1 12 3 66 38 26 45 54 75 79 95 20 2 71 100 91 23 49 63 86 88 37 93 39 15 57"],["660"]],[["100","58 66 46 88 94 95 9 81 61 78 65 19 40 17 20 86 89 62 100 14 73 34 39 35 43 90 69 49 55 74 72 85 63 41 83 36 70 98 11 84 24 26 99 30 68 51 54 31 47 33 10 75 7 77 16 28 1 53 67 91 44 64 45 60 8 27 4 42 6 79 76 22 97 92 29 80 82 96 3 2 71 37 5 52 93 13 87 23 56 50 25 38 18 21 12 57 32 59 15 48"],["324"]],[["100","9 94 1 12 46 51 77 59 15 34 45 49 8 80 4 35 91 20 52 27 78 36 73 95 58 61 11 79 42 41 5 7 60 40 70 72 74 17 30 19 3 68 37 67 13 29 54 25 26 63 10 71 32 83 99 88 65 97 39 2 33 43 82 75 62 98 44 66 89 81 76 85 92 87 56 31 14 53 16 96 24 23 64 38 48 55 28 86 69 21 100 84 47 6 57 22 90 93 18 50"],["12870"]],[["100","40 97 71 53 25 31 50 62 68 39 17 32 88 81 73 58 36 98 64 6 65 33 91 8 74 51 27 28 89 15 90 84 79 44 41 54 49 3 5 10 99 34 82 48 59 13 69 18 66 67 60 63 4 96 26 95 45 76 57 22 14 72 93 83 11 70 56 35 61 16 19 21 1 52 38 43 85 92 100 37 42 23 2 55 87 75 29 80 30 77 12 78 46 47 20 24 7 86 9 94"],["825"]],[["100","85 59 62 27 61 12 80 15 1 100 33 84 79 28 69 11 18 92 2 99 56 81 64 50 3 32 17 7 63 21 53 89 54 46 90 72 86 26 51 23 8 19 44 48 5 25 42 14 29 35 55 82 6 83 88 74 67 66 98 4 70 38 43 37 91 40 78 96 9 75 45 95 93 30 68 47 65 34 58 39 73 16 49 60 76 10 94 87 41 71 13 57 97 20 24 31 22 77 52 36"],["1650"]],[["100","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 17 18 19 20 21 22 23 24 25 26 16 28 29 30 31 32 33 34 35 36 37 38 39 27 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 40 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 57 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 76 99 100"],["111546435"]],[["26","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 17 18 19 20 21 22 23 24 25 26 16"],["1155"]],[["100","2 1 4 5 3 7 8 9 10 6 12 13 14 15 16 17 11 19 20 21 22 23 24 25 26 27 28 18 30 31 32 33 34 35 36 37 38 39 40 41 29 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 42 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 59 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 78"],["111546435"]],[["6","2 3 4 1 6 5"],["2"]],[["39","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 17 18 19 20 21 22 23 24 25 26 16 28 29 30 31 32 33 34 35 36 37 38 39 27"],["15015"]],[["15","2 3 4 5 1 7 8 9 10 6 12 13 14 15 11"],["5"]],[["98","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 17 18 19 20 21 22 23 24 25 26 16 28 29 30 31 32 33 34 35 36 37 38 39 27 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 40 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 57 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 76"],["111546435"]],[["100","2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 20 38 39 40 41 42 43 44 45 46 47 48 49 37 51 52 53 54 55 56 57 58 59 60 50 62 63 64 65 66 67 61 69 70 71 72 68 74 75 76 77 78 79 80 81 73 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 82 98 99 100"],["116396280"]],[["4","2 3 4 2"],["-1"]],[["93","2 3 4 5 1 7 8 9 10 11 12 6 14 15 16 17 18 19 20 21 22 23 13 25 26 27 28 29 30 31 32 33 34 35 36 24 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 37 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 54 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 73"],["4849845"]],[["15","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9"],["105"]],[["41","2 3 4 5 6 7 8 9 10 11 1 13 14 15 16 17 18 19 20 21 22 23 24 12 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 25"],["2431"]],[["100","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 17 18 19 20 21 22 23 24 25 26 16 28 29 30 31 32 33 34 35 36 37 38 39 27 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 40 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 57 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 76 100 99"],["111546435"]],[["24","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 17 18 19 20 21 22 23 24 16"],["315"]],[["90","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 17 18 19 20 21 22 23 24 25 26 16 28 29 30 31 32 33 34 35 36 37 38 39 27 41 42 43 44 45 46 47 48 49 50 51 52 53 54 40 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 55 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 72"],["4849845"]],[["99","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 17 18 19 20 21 22 23 24 16 26 27 28 29 30 31 32 33 34 35 25 37 38 39 40 41 42 43 44 45 46 47 48 36 50 51 52 53 54 55 56 57 58 59 60 61 62 63 49 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 64 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 81"],["14549535"]],[["75","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 17 18 19 20 21 22 23 24 25 26 16 28 29 30 31 32 33 34 35 36 37 38 39 27 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 40 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 57"],["4849845"]],[["9","2 3 4 5 6 7 8 9 1"],["9"]],[["26","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 26 16 17 18 19 20 21 22 23 24 25"],["1155"]],[["99","2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 1 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 51"],["1225"]],[["96","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 17 18 19 20 21 22 23 24 25 26 16 28 29 30 31 32 33 34 35 36 37 38 39 27 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 40 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 57 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 76"],["4849845"]],[["100","2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 18 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 37 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 57 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 78"],["1560090"]],[["48","2 3 1 5 6 7 8 4 10 11 12 13 14 15 9 17 18 19 20 21 22 23 24 16 26 27 28 29 30 31 32 33 34 35 25 37 38 39 40 41 42 43 44 45 46 47 48 36"],["45045"]],[["100","2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1"],["50"]],[["12","2 3 4 5 1 7 8 9 10 11 12 6"],["35"]],[["12","2 3 4 1 6 7 8 9 10 11 12 5"],["4"]],[["100","2 1 5 3 4 10 6 7 8 9 17 11 12 13 14 15 16 28 18 19 20 21 22 23 24 25 26 27 41 29 30 31 32 33 34 35 36 37 38 39 40 58 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 77 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 100 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99"],["111546435"]],[["100","2 3 4 5 6 7 8 9 10 11 1 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 12 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 29 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 48 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 71 100"],["2369851"]]]}} +{"instance_id":"pseudo_to_code_0.5k_140","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n x is a new array of integers with 31 element\n create new array of integers y with 31 element\n z is a new 2d array of integers with size 31 by 31\n declare integer variables n, m, i, j and k\n read n and loop further\n change first sizeof(x) bytes at the pointer x to 0\n set the values of sizeof(y) bytes at the pointer y to 0\n for i from 0 to n exclusive\n for j = 0 to n exclusive, read from the input to z[i][j]\n end of the block\n start for loop from i = 0 to n exclusive incrementing i\n in a for loop, change j from 0 to n exclusive\n increase x[i] by z[i][j]\n change y[i] to the sum of y[i] and z[j][i]\n end of the block\n end of the block\n assign 0 to k\n in a for loop, change i from 0 to n exclusive incrementing i\n start for loop from j = 0 to n exclusive incrementing j\n if y[j] is greater than x[i], increment k\n end of the block\n end of the block\n print k\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int x[31];\n int y[31];\n int z[31][31];\n int n, m, i, j, k;\n while (cin >> n) {\n memset(x, 0, sizeof(x));\n memset(y, 0, sizeof(y));\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) { cin >> z[i][j]; }\n }\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n x[i] += z[i][j];\n y[i] += z[j][i];\n }\n }\n k = 0;\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n if (y[j] > x[i]) k++;\n }\n }\n cout << k << endl;\n }\n return 0;\n}","item":{"problem_id":"157A","pseudocode":"define the main function\n x is a new array of integers with 31 element\n create new array of integers y with 31 element\n z is a new 2d array of integers with size 31 by 31\n declare integer variables n, m, i, j and k\n read n and loop further\n change first sizeof(x) bytes at the pointer x to 0\n set the values of sizeof(y) bytes at the pointer y to 0\n for i from 0 to n exclusive\n for j = 0 to n exclusive, read from the input to z[i][j]\n end of the block\n start for loop from i = 0 to n exclusive incrementing i\n in a for loop, change j from 0 to n exclusive\n increase x[i] by z[i][j]\n change y[i] to the sum of y[i] and z[j][i]\n end of the block\n end of the block\n assign 0 to k\n in a for loop, change i from 0 to n exclusive incrementing i\n start for loop from j = 0 to n exclusive incrementing j\n if y[j] is greater than x[i], increment k\n end of the block\n end of the block\n print k\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["1","1"],["0"]],[["2","1 2","3 4"],["2"]],[["4","5 7 8 4","9 5 3 2","1 6 6 4","9 5 7 3"],["6"]],[["2","1 1","1 1"],["0"]],[["3","1 2 3","4 5 6","7 8 9"],["4"]],[["3","1 2 3","3 1 2","2 3 1"],["0"]],[["4","1 2 3 4","8 7 6 5","9 10 11 12","16 15 14 13"],["8"]],[["1","53"],["0"]],[["5","1 98 22 9 39","10 9 44 49 66","79 17 23 8 47","59 69 72 47 14","94 91 98 19 54"],["13"]],[["1","31"],["0"]],[["1","92"],["0"]],[["5","61 45 70 19 48","52 29 98 21 74","21 66 12 6 55","62 75 66 62 57","94 74 9 86 24"],["13"]],[["2","73 99","13 100"],["2"]],[["4","89 79 14 89","73 24 58 89","62 88 69 65","58 92 18 83"],["10"]],[["5","99 77 32 20 49","93 81 63 7 58","37 1 17 35 53","18 94 38 80 23","91 50 42 61 63"],["12"]],[["4","81 100 38 54","8 64 39 59","6 12 53 65","79 50 99 71"],["8"]],[["5","42 74 45 85 14","68 94 11 3 89","68 67 97 62 66","65 76 96 18 84","61 98 28 94 74"],["12"]],[["9","53 80 94 41 58 49 88 24 42","85 11 32 64 40 56 63 95 73","17 85 60 41 13 71 54 67 87","38 14 21 81 66 59 52 33 86","29 34 46 18 19 80 10 44 51","4 27 65 75 77 21 15 49 50","35 68 86 98 98 62 69 52 71","43 28 56 91 89 21 14 57 79","27 27 29 26 15 76 21 70 78"],["40"]],[["7","80 81 45 81 72 19 65","31 24 15 52 47 1 14","81 35 42 24 96 59 46","16 2 59 56 60 98 76","20 95 10 68 68 56 93","60 16 68 77 89 52 43","11 22 43 36 99 2 11"],["21"]],[["9","33 80 34 56 56 33 27 74 57","14 69 78 44 56 70 26 73 47","13 42 17 33 78 83 94 70 37","96 78 92 6 16 68 8 31 46","67 97 21 10 44 64 15 77 28","34 44 83 96 63 52 29 27 79","23 23 57 54 35 16 5 64 36","29 71 36 78 47 81 72 97 36","24 83 70 58 36 82 42 44 26"],["41"]],[["9","57 70 94 69 77 59 88 63 83","6 79 46 5 9 43 20 39 48","46 35 58 22 17 3 81 82 34","77 10 40 53 71 84 14 58 56","6 92 77 81 13 20 77 29 40","59 53 3 97 21 97 22 11 64","52 91 82 20 6 3 99 17 44","79 25 43 69 85 55 95 61 31","89 24 50 84 54 93 54 60 87"],["46"]],[["5","77 44 22 21 20","84 3 35 86 35","97 50 1 44 92","4 88 56 20 3","32 56 26 17 80"],["13"]],[["7","62 73 50 63 66 92 2","27 13 83 84 88 81 47","60 41 25 2 68 32 60","7 94 18 98 41 25 72","69 37 4 10 82 49 91","76 26 67 27 30 49 18","44 78 6 1 41 94 80"],["26"]],[["9","40 70 98 28 44 78 15 73 20","25 74 46 3 27 59 33 96 19","100 47 99 68 68 67 66 87 31","26 39 8 91 58 20 91 69 81","77 43 90 60 17 91 78 85 68","41 46 47 50 96 18 69 81 26","10 58 2 36 54 64 69 10 65","6 86 26 7 88 20 43 92 59","61 76 13 23 49 28 22 79 8"],["44"]],[["8","44 74 25 81 32 33 55 58","36 13 28 28 20 65 87 58","8 35 52 59 34 15 33 16","2 22 42 29 11 66 30 72","33 47 8 61 31 64 59 63","79 36 38 42 12 21 92 36","56 47 44 6 6 1 37 2","79 88 79 53 50 69 94 39"],["31"]],[["5","4 91 100 8 48","78 56 61 49 83","12 21 95 77 78","40 20 91 79 25","32 88 94 28 55"],["10"]],[["5","23 70 5 36 69","83 18 19 98 40","84 91 18 51 35","17 18 35 47 59","29 72 35 87 27"],["13"]],[["12","8 42 23 20 39 5 23 86 26 65 93 82","48 35 12 4 59 19 19 28 38 81 97 99","93 24 31 44 97 50 44 99 50 7 10 64","79 43 65 29 84 43 46 41 89 16 6 1","34 90 33 1 7 12 46 84 67 30 1 58","58 21 100 66 56 22 7 24 72 73 86 37","2 17 85 6 2 73 85 44 43 79 34 65","3 53 29 76 87 2 27 19 11 42 71 38","69 82 73 52 44 23 92 10 13 72 59 16","73 32 37 93 21 94 43 39 27 53 14 15","86 16 90 91 14 50 73 61 77 36 93 90","22 56 30 52 81 70 12 92 75 27 38 12"],["77"]],[["3","41 94 58","73 61 8","34 88 89"],["5"]],[["3","1 2 3","1 1 1","1 1 1"],["4"]],[["2","7 3","9 5"],["2"]],[["3","4 3 2","2 2 2","2 2 2"],["4"]]]}} +{"instance_id":"pseudo_to_code_0.5k_141","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let n, c be ints\n read n and c\n y = int\n read y\n cur = y = int\n ans = 1 = int\n x = int\n for i = 0 to n-1 exclusive\n read x\n if the abs of cur-x to int is <= c\n increment ans\n else\n reset ans to 1\n end of the block\n set cur to x\n end of the block\n print ans and new line\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, c;\n cin >> n >> c;\n int y;\n cin >> y;\n int cur = y;\n int ans = 1;\n int x;\n for (int i = 0; i < n - 1; i++) {\n cin >> x;\n if ((int)abs(cur - x) <= c) {\n ans++;\n } else {\n ans = 1;\n }\n cur = x;\n }\n cout << ans << '\\n';\n}","item":{"problem_id":"716A","pseudocode":"define the main function\n let n, c be ints\n read n and c\n y = int\n read y\n cur = y = int\n ans = 1 = int\n x = int\n for i = 0 to n-1 exclusive\n read x\n if the abs of cur-x to int is <= c\n increment ans\n else\n reset ans to 1\n end of the block\n set cur to x\n end of the block\n print ans and new line\nend of the block","testcases":[[["6 5","1 3 8 14 19 20"],["3"]],[["6 1","1 3 5 7 9 10"],["2"]],[["1 1","1000000000"],["1"]],[["5 5","1 7 12 13 14"],["4"]],[["2 1000000000","1 1000000000"],["2"]],[["3 5","1 10 20"],["1"]],[["3 10","1 2 3"],["3"]],[["2 1","1 100"],["1"]],[["3 1","1 2 10"],["1"]],[["2 1","1 2"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_142","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integer n\n create long longs a and Ans and long long array ara with size 101\n read n\n read a\n assign value of a to Ans\n for integer i = 1 to n exclusive\n read ara[i]\n increase Ans by (ara[i] - 1) * (i + 1) + 1\n end of the block\n print Ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n long long a, ara[101], Ans;\n cin >> n;\n cin >> a;\n Ans = a;\n for (int i = 1; i < n; i++) {\n cin >> ara[i];\n Ans += (ara[i] - 1) * (i + 1) + 1;\n }\n cout << Ans << endl;\n return 0;\n}","item":{"problem_id":"103A","pseudocode":"define the main function\n declare integer n\n create long longs a and Ans and long long array ara with size 101\n read n\n read a\n assign value of a to Ans\n for integer i = 1 to n exclusive\n read ara[i]\n increase Ans by (ara[i] - 1) * (i + 1) + 1\n end of the block\n print Ans\n return to indicate successful execution\nend of the block","testcases":[[["2","1 1"],["2"]],[["2","2 2"],["5"]],[["1","10"],["10"]],[["3","2 4 1"],["10"]],[["4","5 5 3 1"],["22"]],[["2","1000000000 1000000000"],["2999999999"]],[["10","5 7 8 1 10 3 6 4 10 6"],["294"]],[["100","5 7 5 3 5 4 6 5 3 6 4 6 6 2 1 9 6 5 3 8 4 10 1 9 1 3 7 6 5 5 8 8 7 7 8 9 2 10 3 5 4 2 6 10 2 6 9 6 1 9 3 7 7 8 3 9 9 5 10 10 3 10 7 8 3 9 8 3 2 4 10 2 1 1 7 3 9 10 4 6 9 8 2 1 4 10 1 10 6 8 7 5 3 3 6 2 7 10 3 8"],["24212"]],[["100","96 23 25 62 34 30 85 15 26 61 59 87 34 99 60 41 52 73 63 84 50 89 42 29 87 99 19 94 84 43 82 90 41 100 60 61 99 49 26 3 97 5 24 34 51 59 69 61 11 41 72 60 33 36 18 29 82 53 18 80 52 98 38 32 56 95 55 79 32 80 37 64 45 13 62 80 70 29 1 58 88 24 79 68 41 80 12 72 52 39 64 19 54 56 70 58 19 3 83 62"],["261115"]],[["100","883 82 79 535 478 824 700 593 262 385 403 183 176 386 126 648 710 516 922 97 800 728 372 9 954 911 975 526 476 3 74 459 471 174 295 831 698 21 927 698 580 856 712 430 5 473 592 40 301 230 763 266 38 213 393 70 333 779 811 249 130 456 763 657 578 699 939 660 898 918 438 855 892 85 35 232 54 593 849 777 917 979 796 322 473 887 284 105 522 415 86 480 80 592 516 227 680 574 488 644"],["2519223"]],[["100","6659 5574 5804 7566 7431 1431 3871 6703 200 300 3523 3580 8500 2312 4812 3149 3324 5846 8965 5758 5831 1341 7733 4477 355 3024 2941 9938 1494 16 1038 8262 9938 9230 5192 8113 7575 7696 5566 2884 8659 1951 1253 6480 3877 3707 5482 3825 5359 44 3219 3258 1785 5478 4525 5950 2417 1991 8885 4264 8769 2961 7107 8904 5097 2319 5713 8811 9723 8677 2153 3237 7174 9528 9260 7390 3050 6823 6239 5222 4602 933 7823 4198 8304 244 5845 3189 4490 3216 7877 6323 1938 4597 880 1206 1691 1405 4122 5950"],["24496504"]],[["50","515844718 503470143 928669067 209884122 322869098 241621928 844696197 105586164 552680307 968792756 135928721 842094825 298782438 829020472 791637138 285482545 811025527 428952878 887796419 11883658 546401594 6272027 100292274 308219869 372132044 955814846 644008184 521195760 919389466 215065725 687764134 655750167 181397022 404292682 643251185 776299412 741398345 865144798 369796727 673902099 124966684 35796775 794385099 594562033 550366869 868093561 695094388 580789105 755076935 198783899"],["685659563557"]],[["10","12528238 329065023 620046219 303914458 356423530 751571368 72944261 883971060 123105651 868129460"],["27409624352"]],[["1","84355694"],["84355694"]],[["2","885992042 510468669"],["1906929379"]],[["100","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"],["100"]],[["100","2 1 2 2 2 2 1 2 2 1 2 2 2 1 2 1 2 2 1 2 2 2 2 2 2 1 2 1 1 2 1 1 2 1 2 1 1 1 2 2 2 2 2 1 2 2 2 2 1 1 1 1 1 2 2 1 1 1 2 2 1 1 2 1 1 2 2 2 2 1 2 2 2 1 2 1 2 2 1 2 1 1 1 2 2 1 2 1 2 1 1 1 2 1 2 2 2 1 1 1"],["2686"]],[["100","1 3 2 1 1 2 1 3 2 2 3 1 1 1 2 2 1 3 3 1 1 2 2 3 2 1 3 1 3 2 1 1 3 3 2 1 2 2 2 3 2 2 3 2 2 3 2 1 3 1 1 2 1 3 2 2 1 1 1 1 1 1 3 1 2 3 1 1 1 1 1 2 3 3 1 1 1 1 2 3 3 1 3 2 2 3 2 1 3 2 2 3 1 1 3 2 3 2 3 1"],["4667"]]]}} +{"instance_id":"pseudo_to_code_0.5k_143","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, i, j, count = integers with count = 0\n sii = stack of integer\n s = string\n read n, s\n for i = s.size() - 1 down to 0, push s[i] - 0 in sii\n while (not sii.empty())\n j = top of sii\n pop sii\n if (j + 1 is 2)\n increment count\n else if (j + 1 is 1)\n increment count\n break loop\n end of the block\n end of the block\n print count\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, i, j, count = 0;\n stack sii;\n string s;\n cin >> n >> s;\n for (i = s.size() - 1; i >= 0; i--) { sii.push(s[i] - '0'); }\n while (!sii.empty()) {\n j = sii.top();\n sii.pop();\n if (j + 1 == 2) {\n count++;\n } else if (j + 1 == 1) {\n count++;\n break;\n }\n }\n cout << count << endl;\n}","item":{"problem_id":"465A","pseudocode":"define the main function\n n, i, j, count = integers with count = 0\n sii = stack of integer\n s = string\n read n, s\n for i = s.size() - 1 down to 0, push s[i] - 0 in sii\n while (not sii.empty())\n j = top of sii\n pop sii\n if (j + 1 is 2)\n increment count\n else if (j + 1 is 1)\n increment count\n break loop\n end of the block\n end of the block\n print count\nend of the block","testcases":[[["4","1100"],["3"]],[["4","1111"],["4"]],[["1","0"],["1"]],[["1","1"],["1"]],[["2","00"],["1"]],[["2","01"],["1"]],[["2","10"],["2"]],[["2","11"],["2"]],[["10","0000000000"],["1"]],[["20","11111111110110001100"],["11"]],[["50","01011110100010000001010000100001001101001101101011"],["1"]],[["60","111111111101111111111111111111111111111111111111111111111111"],["11"]],[["60","111111111111111111111111111111111111111111111111111111111111"],["60"]],[["66","111111010010011001110011000111000100011110011001111110011111111101"],["7"]],[["90","000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"],["1"]],[["91","1011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"],["2"]],[["92","11111111101011111011111111111111111111111011101111111111011111111111111101111111101011111101"],["10"]],[["100","0001011110100011001100100010111001000001111101101001001001001011110100101101010000000110100101110010"],["1"]],[["100","0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"],["1"]],[["100","0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"],["1"]],[["100","0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"],["1"]],[["100","1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"],["100"]],[["100","1011001110001000011111110011000100001110010110111101110110011011011000010100110001111100000010110010"],["2"]],[["100","1101111011001111111111110011110111101110111111111111111111111111111111011111111111110111111111111111"],["3"]],[["100","1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"],["100"]],[["100","1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110"],["100"]],[["100","1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101"],["99"]],[["100","1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000"],["96"]],[["100","1111111111111111111111111111111110011000110110001010101100100100001000010010010010000100110000010101"],["34"]]]}} +{"instance_id":"pseudo_to_code_0.5k_144","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n,x,y=long long\n ny=long long\n wasOut=bool\n borderPoints=0\n nx=0\n read n\n if n is 0\n print 1\n return to indicate successful execution\n else if n<0\n return to indicate successful execution\n end of the block\n subtract n from x\n while x<=0\n wasOut=true\n ny=sqrt(n*n-x*x)+1\n for y=-ny to 0 inclusive\n if x*x+y*y <= n*n\n if wasOut is true\n wasOut=false\n increment borderPoints\n if x is 0 increment nx\n else\n if x<0\n if (x-1)^2+y^2 > n^2\n increment borderPoints\n if x is 0 increment nx\n else\n y=n+1\n end of the block\n else if x>0\n if (x+1)^2+y^2 > n^2\n increment borderPoints\n if x is 0 increment nx\n else\n y=n+1\n end of the block\n end of the block\n end of the block\n end of the block\n end of the block\n increment x\n end of the block\n print 2*(borderPoints*2-nx)-2\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long n, x, y;\n long long ny;\n bool wasOut;\n long long borderPoints = 0;\n long long nx = 0;\n cin >> n;\n if (n == 0) {\n cout << 1 << endl;\n return 0;\n } else if (n < 0) {\n return 0;\n }\n x = -n;\n while (x <= 0) {\n wasOut = true;\n ny = sqrt(n * n - x * x) + 1;\n for (y = -ny; y <= 0; y++) {\n if (x * x + y * y <= n * n) {\n if (wasOut == true) {\n wasOut = false;\n borderPoints++;\n if (x == 0) { nx++; }\n } else {\n if (x < 0) {\n if ((x - 1) * (x - 1) + y * y > n * n) {\n borderPoints++;\n if (x == 0) { nx++; }\n } else {\n y = n + 1;\n }\n } else if (x > 0) {\n if ((x + 1) * (x + 1) + y * y > n * n) {\n borderPoints++;\n if (x == 0) { nx++; }\n } else {\n y = n + 1;\n }\n }\n }\n }\n }\n x++;\n }\n cout << 2 * (borderPoints * 2 - nx) - 2 << endl;\n return 0;\n}","item":{"problem_id":"392A","pseudocode":"define the main function\n n,x,y=long long\n ny=long long\n wasOut=bool\n borderPoints=0\n nx=0\n read n\n if n is 0\n print 1\n return to indicate successful execution\n else if n<0\n return to indicate successful execution\n end of the block\n subtract n from x\n while x<=0\n wasOut=true\n ny=sqrt(n*n-x*x)+1\n for y=-ny to 0 inclusive\n if x*x+y*y <= n*n\n if wasOut is true\n wasOut=false\n increment borderPoints\n if x is 0 increment nx\n else\n if x<0\n if (x-1)^2+y^2 > n^2\n increment borderPoints\n if x is 0 increment nx\n else\n y=n+1\n end of the block\n else if x>0\n if (x+1)^2+y^2 > n^2\n increment borderPoints\n if x is 0 increment nx\n else\n y=n+1\n end of the block\n end of the block\n end of the block\n end of the block\n end of the block\n increment x\n end of the block\n print 2*(borderPoints*2-nx)-2\n return to indicate successful execution\nend of the block","testcases":[[["1"],["4"]],[["2"],["8"]],[["3"],["16"]],[["4"],["20"]],[["0"],["1"]],[["30426905"],["172120564"]],[["38450759"],["217510336"]],[["743404"],["4205328"]],[["3766137"],["21304488"]],[["19863843"],["112366864"]],[["24562258"],["138945112"]],[["24483528"],["138499748"]],[["25329968"],["143287936"]],[["31975828"],["180882596"]],[["2346673"],["13274784"]],[["17082858"],["96635236"]],[["22578061"],["127720800"]],[["17464436"],["98793768"]],[["18855321"],["106661800"]],[["614109"],["3473924"]],[["3107977"],["17581372"]],[["39268638"],["222136960"]],[["31416948"],["177721092"]],[["34609610"],["195781516"]],[["17590047"],["99504332"]],[["12823666"],["72541608"]],[["34714265"],["196373536"]],[["2870141"],["16235968"]],[["15012490"],["84923464"]],[["31988776"],["180955840"]],[["1059264"],["5992100"]],[["5626785"],["31829900"]],[["33146037"],["187502300"]],[["17"],["96"]],[["40000000"],["226274168"]],[["5"],["28"]],[["6"],["32"]],[["7"],["36"]],[["8"],["44"]],[["9"],["48"]],[["10"],["56"]],[["11"],["60"]],[["12"],["64"]],[["13"],["72"]],[["14"],["76"]],[["15"],["84"]],[["16"],["88"]],[["25"],["140"]],[["39999999"],["226274164"]],[["39999998"],["226274156"]],[["39999997"],["226274152"]],[["39999996"],["226274144"]],[["39099999"],["221182992"]],[["46340"],["262136"]],[["46341"],["262144"]],[["395938"],["2239760"]]]}} +{"instance_id":"pseudo_to_code_0.5k_145","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, k = int\n read n then k\n s = string\n read s\n pos, post = int\n for i = 0 to n\n if s[i] is 'G' set pos to i\n if s[i] is 'T' set post to i\n end of the block\n if abs of (pos - post) mod k is not 0\n print \"NO\"\n else\n f = bool with f = 1\n if pos < post\n for i = pos to post inclusive incrementing i by k\n if s8i] is '#' set f to 0\n else\n for i = pos to post inclusive decrementing i by k\n if s[i] is '#' set f to 0\n end of the block\n print \"YES\" if f else print \"NO\"\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, k;\n cin >> n >> k;\n string s;\n cin >> s;\n int pos, post;\n for (int i = 0; i < n; i++) {\n if (s[i] == 'G') pos = i;\n if (s[i] == 'T') post = i;\n }\n if (abs(pos - post) % k != 0)\n cout << \"NO\\n\";\n else {\n bool f = 1;\n if (pos < post) {\n for (int i = pos; i <= post; i += k)\n if (s[i] == '#') f = 0;\n } else {\n for (int i = pos; i >= post; i -= k)\n if (s[i] == '#') f = 0;\n }\n cout << (f ? \"YES\" : \"NO\") << '\\n';\n }\n return 0;\n}","item":{"problem_id":"735A","pseudocode":"define the main function\n n, k = int\n read n then k\n s = string\n read s\n pos, post = int\n for i = 0 to n\n if s[i] is 'G' set pos to i\n if s[i] is 'T' set post to i\n end of the block\n if abs of (pos - post) mod k is not 0\n print \"NO\"\n else\n f = bool with f = 1\n if pos < post\n for i = pos to post inclusive incrementing i by k\n if s8i] is '#' set f to 0\n else\n for i = pos to post inclusive decrementing i by k\n if s[i] is '#' set f to 0\n end of the block\n print \"YES\" if f else print \"NO\"\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["5 2","#G#T#"],["YES"]],[["6 1","T....G"],["YES"]],[["7 3","T..#..G"],["NO"]],[["6 2","..GT.."],["NO"]],[["2 1","GT"],["YES"]],[["100 5","G####.####.####.####.####.####.####.####.####.####.####.####.####.####.####.####.####.####.####T####"],["YES"]],[["100 5","G####.####.####.####.####.####.####.####.####.####.####.####.####.#########.####.####.####.####T####"],["NO"]],[["2 1","TG"],["YES"]],[["99 1","...T.............................................................................................G."],["YES"]],[["100 2","G............#.....#...........#....#...........##............#............#......................T."],["NO"]],[["100 1","#.#.#.##..#..##.#....##.##.##.#....####..##.#.##..GT..##...###.#.##.#..#..##.###..#.####..#.#.##..##"],["YES"]],[["100 2","..#####.#.#.......#.#.#...##..####..###..#.#######GT####.#.#...##...##.#..###....##.#.#..#.###....#."],["NO"]],[["100 3","G..................................................................................................T"],["YES"]],[["100 3","G..................................................................................................T"],["YES"]],[["100 3","G..................................#......#......#.......#.#..........#........#......#..........#.T"],["NO"]],[["100 3","G..............#..........#...#..............#.#.....................#......#........#.........#...T"],["NO"]],[["100 3","G##################################################################################################T"],["NO"]],[["100 33","G..................................................................................................T"],["YES"]],[["100 33","G..................................................................................................T"],["YES"]],[["100 33","G.........#........#..........#..............#.................#............................#.#....T"],["YES"]],[["100 33","G.......#..................#..............................#............................#..........T."],["NO"]],[["100 33","G#..........##...#.#.....................#.#.#.........##..#...........#....#...........##...#..###T"],["YES"]],[["100 33","G..#.#..#..####......#......##...##...#.##........#...#...#.##....###..#...###..##.#.....#......#.T."],["NO"]],[["100 33","G#....#..#..##.##..#.##.#......#.#.##..##.#.#.##.##....#.#.....####..##...#....##..##..........#...T"],["NO"]],[["100 33","G#######.#..##.##.#...#..#.###.#.##.##.#..#.###..####.##.#.##....####...##..####.#..##.##.##.#....#T"],["NO"]],[["100 33","G#####.#.##.###########.##..##..#######..########..###.###..#.####.######.############..####..#####T"],["NO"]],[["100 99","T..................................................................................................G"],["YES"]],[["100 99","T..................................................................................................G"],["YES"]],[["100 99","T.#...............................#............#..............................##...................G"],["YES"]],[["100 99","T..#....#.##...##########.#.#.#.#...####..#.....#..##..#######.######..#.....###..###...#.......#.#G"],["YES"]],[["100 99","G##################################################################################################T"],["YES"]],[["100 9","T..................................................................................................G"],["YES"]],[["100 9","T.................................................................................................G."],["NO"]],[["100 9","T................................................................................................G.."],["NO"]],[["100 1","G..................................................................................................T"],["YES"]],[["100 1","T..................................................................................................G"],["YES"]],[["100 1","##########G.........T###############################################################################"],["YES"]],[["100 1","#################################################################################################G.T"],["YES"]],[["100 17","##########G################.################.################.################T#####################"],["YES"]],[["100 17","####.#..#.G######.#########.##..##########.#.################.################T######.####.#########"],["YES"]],[["100 17",".########.G##.####.#.######.###############..#.###########.##.#####.##.#####.#T.###..###.########.##"],["YES"]],[["100 1","G.............................................#....................................................T"],["NO"]],[["100 1","T.#................................................................................................G"],["NO"]],[["100 1","##########G....#....T###############################################################################"],["NO"]],[["100 1","#################################################################################################G#T"],["NO"]],[["100 17","G################.#################################.################T###############################"],["NO"]],[["100 17","G################.###############..###.######.#######.###.#######.##T######################.###.####"],["NO"]],[["100 17","G####.##.##.#####.####....##.####.#########.##.#..#.###############.T############.#########.#.####.#"],["NO"]],[["48 1","T..............................................G"],["YES"]],[["23 1","T.....................G"],["YES"]],[["49 1","G...............................................T"],["YES"]],[["3 1","TG#"],["YES"]],[["6 2","..TG.."],["NO"]],[["14 3","...G.....#..T."],["NO"]],[["5 4","##GT#"],["NO"]],[["6 2","T#..G."],["YES"]],[["5 2","T.G.#"],["YES"]],[["6 1","T...G#"],["YES"]],[["5 1","TG###"],["YES"]],[["5 4",".G..T"],["NO"]],[["7 2","T#...#G"],["YES"]],[["7 1","##TG###"],["YES"]],[["7 1","###GT##"],["YES"]],[["5 2","G..T."],["NO"]],[["5 1","G.T##"],["YES"]],[["6 2","G.T###"],["YES"]],[["6 2","G#T###"],["YES"]],[["10 2","####T..G.."],["NO"]],[["3 1","GT#"],["YES"]],[["4 1","TG##"],["YES"]],[["6 1",".G..T."],["YES"]],[["10 3","......G..T"],["YES"]],[["3 2","G.T"],["YES"]],[["4 1","#G.T"],["YES"]],[["5 2","T#G##"],["YES"]],[["4 2","G#.T"],["NO"]],[["4 1","GT##"],["YES"]]]}} +{"instance_id":"pseudo_to_code_0.5k_146","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n x=int\n read x\n for y=x\/2 down to 0 exclusive\n for z=0 to y exclusive print *\n for z=0 to x-2*y exclusive print D\n for z=0 to y exclusive print *\n print newline\n end of the block\n for y=0 to x exclusive print D\n print newline\n for y=1 to x\/2 inclusive\n for z=0 to y exclusive print *\n for z=0 to x-2*y exclusive print D\n for z=0 to y exclusive print *\n print newline\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int x;\n cin >> x;\n for (int y = x \/ 2; y > 0; y--) {\n for (int z = 0; z < y; z++) { cout << '*'; }\n for (int z = 0; z < (x - 2 * y); z++) { cout << 'D'; }\n for (int z = 0; z < y; z++) { cout << '*'; }\n cout << '\\n';\n }\n for (int y = 0; y < x; y++) { cout << 'D'; }\n cout << '\\n';\n for (int y = 1; y <= (x \/ 2); y++) {\n for (int z = 0; z < y; z++) { cout << '*'; }\n for (int z = 0; z < (x - 2 * y); z++) { cout << 'D'; }\n for (int z = 0; z < y; z++) { cout << '*'; }\n cout << '\\n';\n }\n}","item":{"problem_id":"454A","pseudocode":"define the main function\n x=int\n read x\n for y=x\/2 down to 0 exclusive\n for z=0 to y exclusive print *\n for z=0 to x-2*y exclusive print D\n for z=0 to y exclusive print *\n print newline\n end of the block\n for y=0 to x exclusive print D\n print newline\n for y=1 to x\/2 inclusive\n for z=0 to y exclusive print *\n for z=0 to x-2*y exclusive print D\n for z=0 to y exclusive print *\n print newline\n end of the block\nend of the block","testcases":[[["3"],["*D*","DDD","*D*"]],[["5"],["**D**","*DDD*","DDDDD","*DDD*","**D**"]],[["7"],["***D***","**DDD**","*DDDDD*","DDDDDDD","*DDDDD*","**DDD**","***D***"]],[["11"],["*****D*****","****DDD****","***DDDDD***","**DDDDDDD**","*DDDDDDDDD*","DDDDDDDDDDD","*DDDDDDDDD*","**DDDDDDD**","***DDDDD***","****DDD****","*****D*****"]],[["15"],["*******D*******","******DDD******","*****DDDDD*****","****DDDDDDD****","***DDDDDDDDD***","**DDDDDDDDDDD**","*DDDDDDDDDDDDD*","DDDDDDDDDDDDDDD","*DDDDDDDDDDDDD*","**DDDDDDDDDDD**","***DDDDDDDDD***","****DDDDDDD****","*****DDDDD*****","******DDD******","*******D*******"]],[["21"],["**********D**********","*********DDD*********","********DDDDD********","*******DDDDDDD*******","******DDDDDDDDD******","*****DDDDDDDDDDD*****","****DDDDDDDDDDDDD****","***DDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDD***","****DDDDDDDDDDDDD****","*****DDDDDDDDDDD*****","******DDDDDDDDD******","*******DDDDDDD*******","********DDDDD********","*********DDD*********","**********D**********"]],[["27"],["*************D*************","************DDD************","***********DDDDD***********","**********DDDDDDD**********","*********DDDDDDDDD*********","********DDDDDDDDDDD********","*******DDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDD*******","********DDDDDDDDDDD********","*********DDDDDDDDD*********","**********DDDDDDD**********","***********DDDDD***********","************DDD************","*************D*************"]],[["35"],["*****************D*****************","****************DDD****************","***************DDDDD***************","**************DDDDDDD**************","*************DDDDDDDDD*************","************DDDDDDDDDDD************","***********DDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDD***********","************DDDDDDDDDDD************","*************DDDDDDDDD*************","**************DDDDDDD**************","***************DDDDD***************","****************DDD****************","*****************D*****************"]],[["49"],["************************D************************","***********************DDD***********************","**********************DDDDD**********************","*********************DDDDDDD*********************","********************DDDDDDDDD********************","*******************DDDDDDDDDDD*******************","******************DDDDDDDDDDDDD******************","*****************DDDDDDDDDDDDDDD*****************","****************DDDDDDDDDDDDDDDDD****************","***************DDDDDDDDDDDDDDDDDDD***************","**************DDDDDDDDDDDDDDDDDDDDD**************","*************DDDDDDDDDDDDDDDDDDDDDDD*************","************DDDDDDDDDDDDDDDDDDDDDDDDD************","***********DDDDDDDDDDDDDDDDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDDDDDDDDDDDDDDDD***********","************DDDDDDDDDDDDDDDDDDDDDDDDD************","*************DDDDDDDDDDDDDDDDDDDDDDD*************","**************DDDDDDDDDDDDDDDDDDDDD**************","***************DDDDDDDDDDDDDDDDDDD***************","****************DDDDDDDDDDDDDDDDD****************","*****************DDDDDDDDDDDDDDD*****************","******************DDDDDDDDDDDDD******************","*******************DDDDDDDDDDD*******************","********************DDDDDDDDD********************","*********************DDDDDDD*********************","**********************DDDDD**********************","***********************DDD***********************","************************D************************"]],[["51"],["*************************D*************************","************************DDD************************","***********************DDDDD***********************","**********************DDDDDDD**********************","*********************DDDDDDDDD*********************","********************DDDDDDDDDDD********************","*******************DDDDDDDDDDDDD*******************","******************DDDDDDDDDDDDDDD******************","*****************DDDDDDDDDDDDDDDDD*****************","****************DDDDDDDDDDDDDDDDDDD****************","***************DDDDDDDDDDDDDDDDDDDDD***************","**************DDDDDDDDDDDDDDDDDDDDDDD**************","*************DDDDDDDDDDDDDDDDDDDDDDDDD*************","************DDDDDDDDDDDDDDDDDDDDDDDDDDD************","***********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*","**DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**","***DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD***","****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD****","*****DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*****","******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD******","*******DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*******","********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD********","*********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*********","**********DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD**********","***********DDDDDDDDDDDDDDDDDDDDDDDDDDDDD***********","************DDDDDDDDDDDDDDDDDDDDDDDDDDD************","*************DDDDDDDDDDDDDDDDDDDDDDDDD*************","**************DDDDDDDDDDDDDDDDDDDDDDD**************","***************DDDDDDDDDDDDDDDDDDDDD***************","****************DDDDDDDDDDDDDDDDDDD****************","*****************DDDDDDDDDDDDDDDDD*****************","******************DDDDDDDDDDDDDDD******************","*******************DDDDDDDDDDDDD*******************","********************DDDDDDDDDDD********************","*********************DDDDDDDDD*********************","**********************DDDDDDD**********************","***********************DDDDD***********************","************************DDD************************","*************************D*************************"]]]}} +{"instance_id":"pseudo_to_code_0.5k_147","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate function f with parameters int a, int b\n x1 = integer, x1 = a \/ 10\n x2 = integer, x2 = remainder of a \/ 10\n x3 = integer, x3 = b \/ 10\n x2 = integer, x4 = remainder of b \/ 10\n if x1 equals x4 and x2 = x3, return 1\n return to indicate successful execution\nend of the block\ndefine the main function\n let a, b be integers\n let s be char\n read a, s, b\n if f(a, b) == 1\n print 0\n if last statement was false\n for int i = 1\n if b + 1 equals 60 and a is smaller than 23\n let b = 0\n add 1 to a\n else if a equals 23\n if b is greater than 32\n print 60 - b\n exit for loop\n if last statement was false\n add one to b\n else\n add one to b\n end of the block\n if f(a, b) equals 1\n print i\n exit for loop\n end of the block\n end of the block\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int f(int a, int b) {\n int x1 = a \/ 10;\n int x2 = a % 10;\n int x3 = b \/ 10;\n int x4 = b % 10;\n if (x1 == x4 && x2 == x3) return 1;\n return 0;\n}\nint main() {\n int a, b;\n char s;\n cin >> a >> s >> b;\n if (f(a, b) == 1)\n cout << \"0\" << endl;\n else {\n for (int i = 1;; i++) {\n if (b + 1 == 60 && a < 23) {\n b = 0;\n a += 1;\n } else if (a == 23) {\n if (b > 32) {\n cout << 60 - b << endl;\n break;\n } else\n b++;\n } else {\n b++;\n }\n if (f(a, b) == 1) {\n cout << i << endl;\n break;\n }\n }\n }\n return 0;\n}","item":{"problem_id":"816A","pseudocode":"create function f with parameters int a, int b\n x1 = integer, x1 = a \/ 10\n x2 = integer, x2 = remainder of a \/ 10\n x3 = integer, x3 = b \/ 10\n x2 = integer, x4 = remainder of b \/ 10\n if x1 equals x4 and x2 = x3, return 1\n return to indicate successful execution\nend of the block\ndefine the main function\n let a, b be integers\n let s be char\n read a, s, b\n if f(a, b) == 1\n print 0\n if last statement was false\n for int i = 1\n if b + 1 equals 60 and a is smaller than 23\n let b = 0\n add 1 to a\n else if a equals 23\n if b is greater than 32\n print 60 - b\n exit for loop\n if last statement was false\n add one to b\n else\n add one to b\n end of the block\n if f(a, b) equals 1\n print i\n exit for loop\n end of the block\n end of the block\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["05:39"],["11"]],[["13:31"],["0"]],[["23:59"],["1"]],[["13:32"],["69"]],[["14:40"],["1"]],[["14:00"],["41"]],[["05:50"],["0"]],[["12:22"],["69"]],[["12:34"],["57"]],[["05:30"],["20"]],[["14:14"],["27"]],[["01:10"],["0"]],[["02:20"],["0"]],[["03:30"],["0"]],[["04:40"],["0"]],[["10:01"],["0"]],[["11:11"],["0"]],[["12:21"],["0"]],[["14:41"],["0"]],[["15:51"],["0"]],[["20:02"],["0"]],[["21:12"],["0"]],[["22:22"],["0"]],[["23:32"],["0"]],[["01:11"],["69"]],[["02:21"],["69"]],[["03:31"],["69"]],[["04:41"],["69"]],[["05:51"],["250"]],[["10:02"],["69"]],[["11:12"],["69"]],[["14:42"],["69"]],[["15:52"],["250"]],[["20:03"],["69"]],[["21:13"],["69"]],[["22:23"],["69"]],[["23:33"],["27"]],[["00:00"],["0"]],[["00:01"],["69"]],[["22:21"],["1"]],[["20:01"],["1"]],[["11:10"],["1"]],[["06:59"],["182"]],[["02:00"],["20"]],[["02:19"],["1"]],[["17:31"],["151"]],[["19:00"],["62"]],[["13:37"],["64"]],[["07:59"],["122"]],[["04:20"],["20"]],[["07:10"],["171"]],[["06:00"],["241"]],[["06:01"],["240"]],[["08:15"],["106"]],[["06:59"],["182"]],[["01:00"],["10"]],[["07:00"],["181"]],[["06:10"],["231"]],[["18:52"],["70"]],[["09:59"],["2"]],[["19:00"],["62"]],[["15:52"],["250"]],[["06:50"],["191"]],[["00:00"],["0"]],[["19:20"],["42"]],[["05:51"],["250"]],[["06:16"],["225"]],[["10:10"],["61"]],[["17:11"],["171"]],[["18:00"],["122"]],[["00:01"],["69"]],[["05:04"],["46"]],[["16:00"],["242"]],[["23:31"],["1"]],[["17:25"],["157"]],[["23:32"],["0"]],[["23:58"],["2"]],[["02:21"],["69"]],[["01:11"],["69"]],[["23:46"],["14"]],[["00:09"],["61"]],[["09:20"],["41"]],[["05:59"],["242"]],[["18:59"],["63"]],[["02:02"],["18"]],[["00:30"],["40"]],[["05:54"],["247"]],[["19:59"],["3"]],[["16:59"],["183"]],[["17:51"],["131"]],[["09:30"],["31"]],[["10:01"],["0"]],[["16:55"],["187"]],[["20:02"],["0"]],[["16:12"],["230"]],[["20:00"],["2"]],[["01:01"],["9"]],[["23:01"],["31"]],[["06:05"],["236"]],[["19:19"],["43"]],[["17:00"],["182"]],[["07:50"],["131"]],[["21:20"],["62"]],[["23:23"],["9"]],[["19:30"],["32"]],[["00:59"],["11"]],[["22:59"],["33"]],[["18:18"],["104"]],[["17:46"],["136"]],[["07:30"],["151"]],[["17:16"],["166"]],[["06:06"],["235"]],[["23:30"],["2"]],[["05:57"],["244"]],[["19:46"],["16"]],[["11:10"],["1"]],[["17:07"],["175"]],[["18:53"],["69"]],[["07:06"],["175"]],[["17:50"],["132"]],[["09:15"],["46"]],[["09:55"],["6"]],[["20:05"],["67"]],[["22:55"],["37"]],[["10:00"],["1"]],[["07:55"],["126"]],[["07:40"],["141"]],[["19:08"],["54"]],[["23:24"],["8"]],[["16:15"],["227"]],[["07:20"],["161"]],[["23:10"],["22"]],[["06:51"],["190"]],[["16:30"],["212"]],[["17:54"],["128"]],[["07:07"],["174"]],[["08:01"],["120"]],[["09:58"],["3"]],[["18:03"],["119"]],[["07:59"],["122"]],[["05:55"],["246"]],[["07:39"],["142"]],[["05:52"],["249"]],[["12:02"],["19"]],[["08:59"],["62"]],[["09:21"],["40"]],[["16:04"],["238"]],[["04:00"],["40"]],[["18:21"],["101"]],[["09:13"],["48"]],[["17:20"],["162"]],[["06:15"],["226"]],[["19:21"],["41"]],[["16:02"],["240"]],[["15:59"],["243"]],[["06:07"],["234"]],[["08:08"],["113"]],[["09:09"],["52"]],[["02:19"],["1"]],[["21:59"],["23"]]]}} +{"instance_id":"pseudo_to_code_0.5k_148","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n integer as n,x\n read n,x\n integer as pre = 0\n integer as i,val\n for = 0 to less than n do the following\n read val\n pre equals pre plus val\n end of the block\n integer as ans = 0\n if pre is greater than 0 then do the following\n set ans to (pre \/ x)\n if pre modulo x is greater than 0 then add one to ans\n end of the block\n if pre is less than 0 then do the following\n set ans to absolute value of pre \/ absolute value of x\n if absolute value of pre modulo absolute value of x is greater than 0 then add one to ans\n end of the block\n output ans\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, x;\n cin >> n >> x;\n int pre = 0;\n int i, val;\n for (i = 0; i < n; i++) {\n cin >> val;\n pre += val;\n }\n int ans = 0;\n if (pre > 0) {\n ans = (pre \/ x);\n if (pre % x > 0) ans++;\n }\n if (pre < 0) {\n ans = (abs(pre) \/ abs(x));\n if (abs(pre) % abs(x) > 0) ans++;\n }\n cout << ans << endl;\n}","item":{"problem_id":"401A","pseudocode":"define the main function\n integer as n,x\n read n,x\n integer as pre = 0\n integer as i,val\n for = 0 to less than n do the following\n read val\n pre equals pre plus val\n end of the block\n integer as ans = 0\n if pre is greater than 0 then do the following\n set ans to (pre \/ x)\n if pre modulo x is greater than 0 then add one to ans\n end of the block\n if pre is less than 0 then do the following\n set ans to absolute value of pre \/ absolute value of x\n if absolute value of pre modulo absolute value of x is greater than 0 then add one to ans\n end of the block\n output ans\nend of the block","testcases":[[["3 2","-1 1 2"],["1"]],[["2 3","-2 -2"],["2"]],[["4 4","1 2 3 4"],["3"]],[["2 2","-1 -1"],["1"]],[["15 5","-2 -1 2 -4 -3 4 -4 -2 -2 2 -2 -1 1 -4 -2"],["4"]],[["15 16","-15 -5 -15 -14 -8 15 -15 -12 -5 -3 5 -7 3 8 -15"],["6"]],[["1 4","-3"],["1"]],[["10 7","6 4 6 6 -3 4 -1 2 3 3"],["5"]],[["2 1","1 -1"],["0"]],[["1 1","0"],["0"]],[["8 13","-11 -1 -11 12 -2 -2 -10 -11"],["3"]],[["16 11","3 -7 7 -9 -2 -3 -4 -2 -6 8 10 7 1 4 6 7"],["2"]],[["67 15","-2 -2 6 -4 -7 4 3 13 -9 -4 11 -7 -6 -11 1 11 -1 11 14 10 -8 7 5 11 -13 1 -1 7 -14 9 -11 -11 13 -4 12 -11 -8 -5 -11 6 10 -2 6 9 9 6 -11 -2 7 -10 -1 9 -8 -5 1 -7 -2 3 -1 -13 -6 -9 -8 10 13 -3 9"],["1"]],[["123 222","44 -190 -188 -185 -55 17 190 176 157 176 -24 -113 -54 -61 -53 53 -77 68 -12 -114 -217 163 -122 37 -37 20 -108 17 -140 -210 218 19 -89 54 18 197 111 -150 -36 -131 -172 36 67 16 -202 72 169 -137 -34 -122 137 -72 196 -17 -104 180 -102 96 -69 -184 21 -15 217 -61 175 -221 62 173 -93 -106 122 -135 58 7 -110 -108 156 -141 -102 -50 29 -204 -46 -76 101 -33 -190 99 52 -197 175 -71 161 -140 155 10 189 -217 -97 -170 183 -88 83 -149 157 -208 154 -3 77 90 74 165 198 -181 -166 -4 -200 -89 -200 131 100 -61 -149"],["8"]],[["130 142","58 -50 43 -126 84 -92 -108 -92 57 127 12 -135 -49 89 141 -112 -31 47 75 -19 80 81 -5 17 10 4 -26 68 -102 -10 7 -62 -135 -123 -16 55 -72 -97 -34 21 21 137 130 97 40 -18 110 -52 73 52 85 103 -134 -107 88 30 66 97 126 82 13 125 127 -87 81 22 45 102 13 95 4 10 -35 39 -43 -112 -5 14 -46 19 61 -44 -116 137 -116 -80 -39 92 -75 29 -65 -15 5 -108 -114 -129 -5 52 -21 118 -41 35 -62 -125 130 -95 -11 -75 19 108 108 127 141 2 -130 54 96 -81 -102 140 -58 -102 132 50 -126 82 6 45 -114 -42"],["5"]],[["7 12","2 5 -1 -4 -7 4 3"],["1"]],[["57 53","-49 7 -41 7 38 -51 -23 8 45 1 -24 26 37 28 -31 -40 38 25 -32 -47 -3 20 -40 -32 -44 -36 5 33 -16 -5 28 10 -22 3 -10 -51 -32 -51 27 -50 -22 -12 41 3 15 24 30 -12 -34 -15 -29 38 -10 -35 -9 6 -51"],["8"]],[["93 273","-268 -170 -163 19 -69 18 -244 35 -34 125 -224 -48 179 -247 127 -150 271 -49 -102 201 84 -151 -70 -46 -16 216 240 127 3 218 -209 223 -227 -201 228 -8 203 46 -100 -207 126 255 40 -58 -217 93 172 -97 23 183 102 -92 -157 -117 173 47 144 -235 -227 -62 -128 13 -151 158 110 -116 68 -2 -148 -206 -52 79 -152 -223 74 -149 -69 232 38 -70 -256 -213 -236 132 -189 -200 199 -57 -108 -53 269 -101 -134"],["8"]],[["1 1000","997"],["1"]],[["4 3","2 -1 -2 -1"],["1"]],[["1 1","-1"],["1"]],[["1 1","1"],["1"]],[["2 2","1 -1"],["0"]],[["2 2","-1 1"],["0"]],[["2 3","-1 1"],["0"]],[["2 2","-2 2"],["0"]],[["2 2","2 2"],["2"]],[["4 2","-1 -1 -1 -1"],["2"]],[["4 1","-1 -1 -1 1"],["2"]],[["3 2","2 2 2"],["3"]],[["10 300","300 300 300 300 300 300 300 300 300 300"],["10"]]]}} +{"instance_id":"pseudo_to_code_0.5k_149","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integers n, y, y2, y3, y4\n read n\n for i = 1 + n to 9020 inclusive\n let y be i % 10\n let y2 be (i \/ 10) % 10\n let y3 be (i \/ 100) % 10\n let y4 be (i \/ 1000) % 10\n if y is not y2 and y is not y3 and y is not y4 and y2 is not y3 and y2 is not y4 and y3 is not y4\n print i and newline\n end loop\n end of the block\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, y, y2, y3, y4;\n cin >> n;\n for (int i = 1 + n; i <= 9020; i++) {\n y = i % 10;\n y2 = (i \/ 10) % 10;\n y3 = (i \/ 100) % 10;\n y4 = (i \/ 1000) % 10;\n if (y != y2 && y != y3 && y != y4 && y2 != y3 && y2 != y4 && y3 != y4) {\n cout << i << endl;\n break;\n }\n }\n return 0;\n}","item":{"problem_id":"271A","pseudocode":"define the main function\n declare integers n, y, y2, y3, y4\n read n\n for i = 1 + n to 9020 inclusive\n let y be i % 10\n let y2 be (i \/ 10) % 10\n let y3 be (i \/ 100) % 10\n let y4 be (i \/ 1000) % 10\n if y is not y2 and y is not y3 and y is not y4 and y2 is not y3 and y2 is not y4 and y3 is not y4\n print i and newline\n end loop\n end of the block\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["1987"],["2013"]],[["2013"],["2014"]],[["1000"],["1023"]],[["1001"],["1023"]],[["1234"],["1235"]],[["5555"],["5601"]],[["9000"],["9012"]],[["1111"],["1203"]],[["8999"],["9012"]],[["4572"],["4573"]],[["6666"],["6701"]],[["2001"],["2013"]],[["3000"],["3012"]],[["7712"],["7801"]],[["8088"],["8091"]],[["1594"],["1596"]],[["6016"],["6017"]],[["8800"],["8901"]],[["3331"],["3401"]],[["5090"],["5091"]],[["2342"],["2345"]],[["2334"],["2340"]],[["1123"],["1203"]],[["8989"],["9012"]],[["8977"],["9012"]],[["6869"],["6870"]],[["8999"],["9012"]]]}} +{"instance_id":"pseudo_to_code_0.5k_150","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create int array ara of size 100 with array of size 100\n create integers i, n, r, z, j, temp, and m\n for i = 0 to 5 exclusive\n for j = 0 to 5 exclusive, read ara[i][j]\n end of the block\n for i = 0 to 5 exclusive\n for j = 0 to 5 exclusive\n if ara[i][j] is equal to 1\n set m to 2 - i\n set n to 2 - j\n end of the block\n end of the block\n end of the block\n if n is less than 0, set n to n * (-1)\n if m is less than 0, set m to m * (-1)\n print m + n\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int ara[100][100];\n int i, n, r, z, j, temp, m;\n for (i = 0; i < 5; i++) {\n for (j = 0; j < 5; j++) { cin >> ara[i][j]; }\n }\n for (i = 0; i < 5; i++) {\n for (j = 0; j < 5; j++) {\n if (ara[i][j] == 1) {\n m = 2 - i;\n n = 2 - j;\n }\n }\n }\n if (n < 0) { n = n * (-1); }\n if (m < 0) { m = m * (-1); }\n cout << m + n << endl;\n return 0;\n}","item":{"problem_id":"263A","pseudocode":"define the main function\n create int array ara of size 100 with array of size 100\n create integers i, n, r, z, j, temp, and m\n for i = 0 to 5 exclusive\n for j = 0 to 5 exclusive, read ara[i][j]\n end of the block\n for i = 0 to 5 exclusive\n for j = 0 to 5 exclusive\n if ara[i][j] is equal to 1\n set m to 2 - i\n set n to 2 - j\n end of the block\n end of the block\n end of the block\n if n is less than 0, set n to n * (-1)\n if m is less than 0, set m to m * (-1)\n print m + n\n return to indicate successful execution\nend of the block","testcases":[[["0 0 0 0 0","0 0 0 0 1","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["3"]],[["0 0 0 0 0","0 0 0 0 0","0 1 0 0 0","0 0 0 0 0","0 0 0 0 0"],["1"]],[["0 0 0 0 0","0 0 0 0 0","0 0 1 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 0 0 0","0 0 0 0 0","0 0 0 0 1"],["4"]],[["0 1 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["3"]],[["1 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["4"]],[["0 0 1 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 1 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["3"]],[["0 0 0 0 1","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["4"]],[["0 0 0 0 0","1 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["3"]],[["0 0 0 0 0","0 1 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 1 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["1"]],[["0 0 0 0 0","0 0 0 1 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","1 0 0 0 0","0 0 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 1 0","0 0 0 0 0","0 0 0 0 0"],["1"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 1","0 0 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","1 0 0 0 0","0 0 0 0 0"],["3"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 1 0 0 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 1 0 0","0 0 0 0 0"],["1"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 1 0","0 0 0 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 1","0 0 0 0 0"],["3"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","1 0 0 0 0"],["4"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 1 0 0 0"],["3"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 1 0 0"],["2"]],[["0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 0 0","0 0 0 1 0"],["3"]]]}} +{"instance_id":"pseudo_to_code_0.5k_151","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n s = string\n read s\n n = int = size of s\n print ((26 * (n + 1)) - n)\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string s;\n cin >> s;\n int n = s.size();\n cout << ((26 * (n + 1)) - n) << endl;\n}","item":{"problem_id":"554A","pseudocode":"define the main function\n s = string\n read s\n n = int = size of s\n print ((26 * (n + 1)) - n)\nend of the block","testcases":[[["a"],["51"]],[["hi"],["76"]],[["y"],["51"]],[["kgan"],["126"]],[["zoabkyuvus"],["276"]],[["spyemhyznjieyhhbk"],["451"]],[["xulsyfkuizjauadjjopu"],["526"]],[["e"],["51"]],[["zv"],["76"]],[["jgv"],["101"]],[["zsfo"],["126"]],[["jselr"],["151"]],[["dwemig"],["176"]],[["mddoxsf"],["201"]],[["jgirkrmi"],["226"]],[["spkxurcum"],["251"]],[["fykkiubdkt"],["276"]],[["fznbcxsxygs"],["301"]],[["qcrvrdqcbtou"],["326"]],[["qktrbjzrqgmlr"],["351"]],[["foamodbvptlxxg"],["376"]],[["ydzpjhsidipricw"],["401"]],[["lpfpndmjfvqejdgf"],["426"]],[["ofkvparuvjtggnmab"],["451"]],[["xxncfutrtxcwdzwbgs"],["476"]],[["zovhffccflkgqncsdte"],["501"]],[["cskgsxywlvfeicoueglr"],["526"]],[["gggggggggggggggggggg"],["526"]],[["qdqdddqddqqddqddqdqd"],["526"]],[["takttttaakaaktakttkt"],["526"]],[["coccoooogogcgocccmcg"],["526"]],[["kskkskkkssksssk"],["401"]],[["lllllllllllllll"],["401"]]]}} +{"instance_id":"pseudo_to_code_0.5k_152","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n integers = n\n set int files to 0\n set int f to 0\n set int sum[500] to 0\n set int index to 0\n read n\n integers = a\n if n is not equal to 0 then do the following\n read a\n if a is less than 0 then increment f by 1\n if f is 3 then do the following\n files equals files plus 1\n set f to 1\n index equals index plus 1\n end of the block\n sum[index] equals sum[index] plus 1\n end of the block\n files equals files plus 1\n output files,endl\n for i = 0 to less than files - 1 then ouput sum[i] and a space\n output sum[files - 1]\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n int files = 0;\n int f = 0;\n int sum[500] = {0};\n int index = 0;\n cin >> n;\n int a;\n while (n-- != 0) {\n cin >> a;\n if (a < 0) { f += 1; }\n if (f == 3) {\n files += 1;\n f = 1;\n index += 1;\n }\n sum[index] += 1;\n }\n files += 1;\n cout << files << endl;\n for (int i = 0; i < files - 1; i++) { cout << sum[i] << ' '; }\n cout << sum[files - 1] << endl;\n return 0;\n}","item":{"problem_id":"250A","pseudocode":"define the main function\n integers = n\n set int files to 0\n set int f to 0\n set int sum[500] to 0\n set int index to 0\n read n\n integers = a\n if n is not equal to 0 then do the following\n read a\n if a is less than 0 then increment f by 1\n if f is 3 then do the following\n files equals files plus 1\n set f to 1\n index equals index plus 1\n end of the block\n sum[index] equals sum[index] plus 1\n end of the block\n files equals files plus 1\n output files,endl\n for i = 0 to less than files - 1 then ouput sum[i] and a space\n output sum[files - 1]\n return to indicate successful execution\nend of the block","testcases":[[["11","1 2 3 -4 -5 -6 5 -5 -6 -7 6"],["3","5 3 3"]],[["5","0 -1 100 -1 0"],["1","5"]],[["1","0"],["1","1"]],[["1","-1"],["1","1"]],[["2","0 0"],["1","2"]],[["2","-2 2"],["1","2"]],[["2","-2 -1"],["1","2"]],[["12","1 -12 -5 -8 0 -8 -1 -1 -6 12 -9 12"],["4","3 3 2 4"]],[["4","1 2 0 3"],["1","4"]],[["4","4 -3 3 3"],["1","4"]],[["4","0 -3 4 -3"],["1","4"]],[["4","-3 -2 4 -3"],["2","3 1"]],[["4","-3 -2 -1 -4"],["2","2 2"]],[["5","-2 -2 4 0 -1"],["2","4 1"]],[["5","-5 -3 -1 2 -1"],["2","2 3"]],[["5","-3 -2 -3 -2 -3"],["3","2 2 1"]],[["10","0 5 2 3 10 9 4 9 9 3"],["1","10"]],[["10","10 2 1 2 9 10 7 4 -4 5"],["1","10"]],[["10","1 -3 1 10 -7 -6 7 0 -5 3"],["2","5 5"]],[["10","6 5 -10 -4 -3 -7 5 -2 -6 -10"],["4","4 3 2 1"]],[["10","-2 -4 -1 -6 -5 -5 -7 0 -7 -8"],["5","2 2 2 3 1"]],[["100","48 36 10 85 15 57 100 70 14 82 15 75 67 44 40 83 12 94 80 77 92 40 39 80 11 10 2 22 71 31 93 51 22 29 98 90 33 91 66 64 87 70 46 86 62 13 85 15 37 3 49 11 21 57 26 14 5 80 33 82 9 75 26 76 50 32 48 100 62 11 97 47 67 81 86 80 51 51 44 97 2 22 18 52 43 54 65 91 94 54 22 80 23 63 44 7 52 98 80 69"],["1","100"]],[["100","7 51 31 14 17 0 72 29 77 6 32 94 70 94 1 64 85 29 67 66 56 -90 38 85 51 5 69 36 62 99 99 43 43 40 68 88 62 39 45 75 50 95 51 96 69 60 65 27 63 89 23 43 49 39 92 90 1 49 22 78 13 90 97 87 5 100 60 82 50 49 0 11 87 34 67 7 35 65 20 92 89 29 73 48 41 8 14 76 91 34 13 18 42 75 36 14 78 80 74 9"],["1","100"]],[["100","83 71 43 50 61 54 -45 44 36 35 44 21 34 65 23 32 73 36 70 17 46 47 10 30 48 25 84 58 63 96 44 88 24 93 26 24 70 69 90 75 20 42 63 11 0 41 54 23 95 99 17 27 43 20 46 100 65 -79 15 72 78 0 13 94 76 72 69 35 61 3 65 83 28 12 27 48 8 37 30 37 40 87 30 76 81 78 71 44 79 92 10 60 5 7 9 33 79 31 86 51"],["1","100"]],[["100","78 96 4 24 -66 42 28 16 42 -48 89 0 74 19 12 86 75 21 42 100 2 43 11 -76 85 24 12 51 26 48 22 74 68 73 22 39 53 42 37 -78 100 5 9 58 10 63 19 89 76 42 10 -96 76 49 67 59 86 37 13 66 75 92 48 80 37 59 49 -4 83 1 82 25 0 31 73 40 52 3 -47 17 68 94 51 84 47 76 73 -65 83 72 56 50 62 -5 40 12 81 75 84 -6"],["5","23 28 27 15 7"]],[["100","-63 20 79 73 18 82 23 -93 55 8 -31 37 33 24 30 41 70 77 14 34 84 79 -94 88 54 81 7 90 74 35 29 3 75 71 14 28 -61 63 90 79 71 97 -90 74 -33 10 27 34 46 31 9 90 100 -73 58 2 73 51 5 46 -27 -9 30 65 73 28 15 14 1 59 96 21 100 78 12 97 72 37 -28 52 12 0 -42 84 88 8 88 8 -48 39 13 -78 20 56 38 82 32 -87 45 39"],["8","10 26 8 16 18 10 9 3"]],[["100","21 40 60 28 85 10 15 -3 -27 -7 26 26 9 93 -3 -65 70 88 68 -85 24 75 24 -69 53 56 44 -53 -15 -74 12 22 37 22 77 90 9 95 40 15 -76 7 -81 65 83 51 -57 59 19 78 34 40 11 17 99 75 56 67 -81 39 22 86 -78 61 19 25 53 13 -91 91 17 71 45 39 63 32 -57 83 70 26 100 -53 7 95 67 -47 84 84 28 56 94 72 48 58 21 -89 91 73 16 93"],["10","9 6 8 5 12 6 16 14 9 15"]],[["100","39 -70 7 7 11 27 88 16 -3 94 94 -2 23 91 41 49 69 61 53 -99 98 54 87 44 48 73 62 80 86 -33 34 -87 56 48 4 18 92 14 -37 84 7 42 9 70 0 -78 17 68 54 -82 65 -21 59 90 72 -19 -81 8 92 88 -68 65 -42 -60 98 -39 -2 2 88 24 9 -95 17 75 12 -32 -9 85 7 88 59 14 90 69 19 -88 -73 1 2 72 15 -83 65 18 26 25 -71 3 -51 95"],["13","11 18 9 11 6 5 3 3 9 10 6 7 2"]],[["100","-47 -28 -90 -35 28 32 63 77 88 3 -48 18 48 22 47 47 89 2 88 46 25 60 65 44 100 28 73 71 19 -55 44 47 30 -25 50 15 -98 5 73 -56 61 15 15 77 67 59 -64 22 17 70 67 -12 26 -81 -58 -20 1 22 34 52 -45 56 78 29 47 -11 -10 70 -57 -2 62 85 -84 -54 -67 67 85 23 6 -65 -6 -79 -13 -1 12 68 1 71 73 77 48 -48 90 70 52 100 45 38 -43 -93"],["15","2 8 23 6 12 3 6 6 3 4 6 2 2 15 2"]],[["100","-34 -61 96 14 87 33 29 64 -76 7 47 -41 54 60 79 -28 -18 88 95 29 -89 -29 52 39 8 13 68 13 15 46 -34 -49 78 -73 64 -56 83 -16 45 17 40 11 -86 55 56 -35 91 81 38 -77 -41 67 16 -37 -56 -84 -42 99 -83 45 46 -56 -14 -15 79 77 -48 -87 94 46 77 18 -32 16 -18 47 67 35 89 95 36 -32 51 46 40 78 0 58 81 -47 41 5 -48 65 89 6 -79 -56 -25 74"],["18","8 7 5 10 3 4 8 5 4 2 5 2 4 7 15 7 2 2"]],[["100","14 36 94 -66 24 -24 14 -87 86 94 44 88 -68 59 4 -27 -74 12 -75 92 -31 29 18 -69 -47 45 -85 67 95 -77 7 -56 -80 -46 -40 73 40 71 41 -86 50 87 94 16 43 -96 96 -63 66 24 3 90 16 42 50 41 15 -45 72 32 -94 -93 91 -31 -30 -73 -88 33 45 9 71 18 37 -26 43 -82 87 67 62 -9 29 -70 -34 99 -30 -25 -86 -91 -70 -48 24 51 53 25 90 69 -17 -53 87 -62"],["20","7 8 3 5 3 5 2 6 8 13 3 2 8 6 3 3 2 2 8 3"]],[["100","-40 87 -68 72 -49 48 -62 73 95 27 80 53 76 33 -95 -53 31 18 -61 -75 84 40 35 -82 49 47 -13 22 -81 -65 -17 47 -61 21 9 -12 52 67 31 -86 -63 42 18 -25 70 45 -3 -18 94 -62 -28 16 -100 36 -96 -73 83 -65 9 -51 83 36 65 -24 77 38 81 -84 32 -34 75 -50 -92 11 -73 -17 81 -66 -61 33 -47 -50 -72 -95 -58 54 68 -46 -41 8 76 28 58 87 88 100 61 -61 75 -1"],["23","4 10 4 5 5 2 5 5 6 3 3 3 4 8 4 3 3 3 2 2 4 11 1"]],[["100","-61 56 1 -37 61 -77 -6 -5 28 36 27 -32 -10 -44 -89 -26 67 100 -94 80 -18 -5 -92 94 81 -38 -76 4 -77 2 79 55 -93 54 -19 10 -35 -12 -42 -32 -23 -67 -95 -62 -16 23 -25 41 -16 -51 3 -45 -1 53 20 0 0 21 87 28 15 62 64 -21 6 45 -19 95 -23 87 15 -35 21 -88 47 -81 89 68 66 -65 95 54 18 -97 65 -7 75 -58 -54 -3 99 -95 -57 -84 98 -6 33 44 81 -56"],["25","5 2 5 2 4 3 4 3 6 3 2 2 2 3 3 3 14 5 4 8 4 2 3 3 5"]],[["100","-21 61 -52 47 -25 -42 -48 -46 58 -13 75 -65 52 88 -59 68 -12 -25 33 14 -2 78 32 -41 -79 17 0 85 -39 -80 61 30 -27 -92 -100 66 -53 -11 -59 65 -5 92 -2 -85 87 -72 19 -50 -24 32 -27 -92 -100 14 72 13 67 -22 -27 -56 -84 -90 -74 -70 44 -92 70 -49 -50 11 57 -73 23 68 65 99 82 -18 -93 -34 85 45 89 -58 -80 5 -57 -98 -11 -96 28 30 29 -71 47 50 -15 30 -96 -53"],["28","4 2 3 5 3 6 5 4 2 3 3 3 4 3 2 6 2 2 3 3 9 2 5 3 2 7 3 1"]],[["100","-61 15 -88 52 -75 -71 -36 29 93 99 -73 -97 -69 39 -78 80 -28 -20 -36 -89 88 -82 56 -37 -13 33 2 -6 -88 -9 8 -24 40 5 8 -33 -83 -90 -48 55 69 -12 -49 -41 -4 92 42 57 -17 -68 -41 -68 77 -17 -45 -64 -39 24 -78 -3 -49 77 3 -23 84 -36 -19 -16 -72 74 -19 -81 65 -79 -57 64 89 -29 49 69 88 -18 16 26 -86 -58 -91 69 -43 -28 86 6 -87 47 -71 18 81 -55 -42 -30"],["30","4 2 5 3 3 2 4 4 2 6 2 4 2 5 2 3 2 3 2 5 2 3 3 4 7 2 3 5 4 2"]],[["100","-21 -98 -66 26 3 -5 86 99 96 -22 78 -16 20 -3 93 22 -67 -37 -27 12 -97 43 -46 -48 -58 -4 -19 26 -87 -61 67 -76 -42 57 -87 -50 -24 -79 -6 43 -68 -42 13 -1 -82 81 -32 -88 -6 -99 46 42 19 -17 89 14 -98 -24 34 -37 -17 49 76 81 -61 23 -46 -79 -48 -5 87 14 -97 -67 -31 94 -77 15 -44 38 -44 -67 -69 -84 -58 -59 -17 -54 3 -15 79 -28 -10 -26 34 -73 -37 -57 -42 -44"],["33","2 7 4 4 3 3 2 3 3 3 2 2 3 3 3 2 7 3 5 3 2 4 3 4 2 2 2 3 3 3 2 2 1"]],[["100","-63 -62 -88 -14 -58 -75 -28 19 -71 60 -38 77 98 95 -49 -64 -87 -97 2 -37 -37 -41 -47 -96 -58 -42 -88 12 -90 -65 0 52 -59 87 -79 -68 -66 -90 -19 -4 86 -65 -49 -94 67 93 -61 100 68 -40 -35 -67 -4 -100 -90 -86 15 -3 -75 57 65 -91 -80 -57 51 -88 -61 -54 -13 -46 -64 53 -87 -54 -69 29 -67 -23 -96 -93 -3 -77 -10 85 55 -44 17 24 -78 -82 -33 14 85 79 84 -91 -81 54 -89 -86"],["35","2 2 2 4 5 2 3 2 2 2 3 5 2 2 3 2 6 2 2 2 3 4 3 2 2 3 2 3 2 2 4 4 6 3 2"]],[["100","30 -47 -87 -49 -4 -58 -10 -10 -37 -15 -12 -85 4 24 -3 -2 57 57 -60 94 -21 82 1 -54 -39 -98 -72 57 84 -6 -41 82 93 -81 -61 -30 18 -68 -88 17 87 -6 43 -26 72 -14 -40 -75 -69 60 -91 -70 -26 -62 -13 -19 -97 -14 -59 -17 -44 -15 -65 60 -60 74 26 -6 12 -83 -49 82 -76 -96 -31 -98 -100 49 -50 -42 -43 92 -56 -79 -38 -86 -99 -37 -75 -26 -79 -12 -9 -87 -63 -62 -25 -3 -5 -92"],["38","3 2 2 2 2 4 5 4 2 4 4 3 4 4 2 3 2 2 2 2 2 2 5 3 3 2 3 2 3 2 2 2 2 2 2 2 2 1"]],[["100","-58 -18 -94 -96 -18 -2 -35 -49 47 69 96 -46 -88 -91 -9 -95 -12 -46 -12 16 44 -53 -96 71 -11 -98 -62 -27 -89 -88 -28 -11 -14 -47 67 -69 -33 -64 15 -24 67 53 -93 -10 -75 -98 -8 -97 -62 67 -52 -59 -9 -89 -39 -23 -37 -61 -83 -89 23 -47 -67 18 -38 -63 -73 -98 -65 -70 -20 13 -33 -46 -50 -30 -33 85 -93 -42 -37 48 -8 -11 -32 0 -58 -70 -27 -79 -52 82 22 -62 -100 -12 -5 -82 88 -74"],["40","2 2 2 5 2 2 2 4 3 2 2 2 2 3 2 5 2 2 2 3 2 2 2 2 3 3 2 2 3 2 2 3 3 2 3 2 4 2 2 3"]],[["100","-60 -62 -19 -42 -50 -22 -90 -82 -56 40 87 -1 -30 -76 -8 -32 -57 38 -14 -39 84 -60 -28 -82 -62 -83 -37 -59 -61 -86 -13 48 18 -8 50 -27 -47 -100 -42 -88 -19 -45 30 -93 -46 3 -26 -80 -61 -13 -20 76 -95 -51 -26 -1 39 -92 -41 -76 -67 26 -23 30 79 -26 -51 -40 -29 -14 -2 -43 -30 -19 -62 -65 -1 -90 -66 -38 -50 89 -17 -53 -6 -13 -41 -54 -1 -23 -31 -88 -59 -44 -67 -11 -83 -16 -23 -71"],["43","2 2 2 2 4 2 2 3 3 2 2 2 2 5 2 2 2 3 3 2 3 2 3 2 3 4 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 1"]],[["100","-1 -65 76 -28 -58 -63 -86 -54 -62 -66 -39 -3 -62 -35 -2 -86 -6 -16 -85 -30 -6 -41 -88 38 -8 -78 -6 -73 -83 -12 40 -99 -78 -51 -97 -15 81 -76 -1 -78 -38 -14 -24 -2 -70 -80 -24 -28 -51 -50 61 -64 -81 -32 -59 -60 -58 -10 -24 -81 -42 -7 58 -23 -11 -14 -84 -27 -45 2 -31 -32 -20 -72 -2 -81 -31 -6 -8 -91 55 -76 -93 -65 -94 -8 -57 -20 -75 -20 -27 -37 -82 97 -37 -8 -16 49 -90 -3"],["45","3 2 2 2 2 2 2 2 2 2 3 2 2 3 2 2 3 2 2 2 2 2 3 2 2 2 2 2 3 2 2 3 2 2 2 2 3 2 2 2 2 2 3 3 2"]],[["100","-75 -29 -14 -2 99 -94 -75 82 -17 -19 -61 -18 -14 -94 -17 16 -16 -4 -41 -8 -81 -26 -65 24 -7 -87 -85 -22 -74 -21 46 -31 -39 -82 -88 -20 -2 -13 -46 -1 -78 -66 -83 -50 -13 -15 -60 -56 36 -79 -99 -52 -96 -80 -97 -74 80 -90 -52 -33 -1 -78 73 -45 -3 -77 62 -4 -85 -44 -62 -74 -33 -35 -44 -14 -80 -20 -17 -83 -32 -40 -74 -13 -90 -62 -15 -16 -59 -15 -40 -50 -98 -33 -73 -25 -86 -35 -84 -41"],["46","2 3 3 2 2 2 3 2 2 3 2 2 3 2 2 2 2 2 2 2 2 3 2 2 3 2 2 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1"]],[["100","-43 -90 -65 -70 -7 -49 -90 -93 -43 -80 -2 -47 -13 -5 -70 -42 -71 -68 -60 -71 -27 -84 82 -74 -75 -65 -32 -32 -50 -74 62 -96 -85 -95 -65 -51 -69 49 3 -19 -92 -61 -33 -7 -70 -51 -3 -1 -48 -48 -64 -7 -4 -46 -11 -36 -80 -69 -67 -1 -39 -40 66 -9 -40 -8 -58 -74 -27 66 -52 -26 -62 -72 -48 -25 -41 -13 -65 -82 -50 -68 -94 -52 -77 -91 -37 -18 -8 -51 -19 -22 -52 -95 35 -32 59 -41 -54 -88"],["46","2 2 2 2 2 2 2 2 2 2 3 2 2 2 3 2 2 4 2 2 2 2 2 2 2 2 2 2 3 2 2 3 2 2 2 2 2 2 2 2 2 2 2 3 3 2"]],[["100","-67 -100 -7 -13 -9 -78 -55 -68 -31 -18 -92 -23 -4 -99 -54 -97 -45 -24 -33 -95 -42 -20 -63 -24 -89 -25 -55 -35 -84 -30 -1 57 -88 -94 -67 -27 -91 -14 -13 -20 -7 -8 -33 -95 -1 -75 -80 -49 -15 -64 -73 -49 -87 -19 -44 -50 -19 -10 -90 -51 -74 90 -42 -18 -93 -99 -43 51 -96 95 -97 -36 -21 -13 -73 -37 -33 -22 -83 -33 -44 -84 -20 -78 -34 -70 -83 -83 -85 -17 -36 62 83 -73 -6 51 -77 -82 -83 -68"],["47","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 4 2 2 2 2 2 2 2 2 2 2 4 3 2 1"]],[["100","-30 -40 -64 -50 -13 -69 -87 -54 -7 -32 -38 30 -79 -31 57 -50 -3 -6 -13 -94 -28 -57 -95 -67 -82 -49 -83 -39 -41 -12 -73 -20 -17 -46 -92 -31 -36 -31 -80 -47 -37 -67 -41 -65 -7 -95 -85 -53 -87 -18 -52 -61 -98 -85 -6 -80 -96 -95 -72 -9 -19 -49 74 84 -60 -69 -64 -39 -82 -28 -24 -82 -13 -7 -15 -28 -26 -48 -88 -9 -36 -38 -75 -1 9 -15 -12 -47 -11 -45 -3 -10 -60 -62 -54 -60 45 -8 -43 -89"],["47","2 2 2 2 2 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 3 2"]],[["100","-78 -77 -84 -29 -99 -15 -60 97 -56 -9 -19 -21 -5 -29 -20 -41 -56 -15 -77 -22 -87 -75 -56 -96 -46 -24 -35 -64 63 -5 -16 -27 34 -77 84 -30 -9 -73 -58 -93 -20 -20 -69 -16 -42 -40 -44 -66 -42 -90 -47 -35 -87 -55 -37 -48 -34 -3 -40 -3 -46 -25 -80 -55 -12 -62 -46 -99 -38 -33 -72 -60 -18 -12 -52 -3 -75 -5 -48 -30 -59 -56 99 -52 -59 -72 -41 -15 -19 -19 -26 -28 -16 -23 -46 -93 -92 -38 -12 -75"],["48","2 2 2 3 2 2 2 2 2 2 2 2 2 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 1"]],[["100","22 -83 -95 -61 -100 -53 -50 -19 -24 -85 -45 -43 -3 -74 -6 -24 -78 -54 -58 -52 -42 -16 -18 -56 -93 -45 -97 -67 -88 -27 83 -7 -72 -85 -24 -45 -22 -82 -83 -94 -75 -79 -22 -44 -22 -44 -42 -44 -61 85 -11 -16 -91 -12 -15 -3 -15 -82 -1 -2 -28 -24 -68 -22 -25 -46 -40 -21 -67 -90 -31 -33 -54 -83 -91 -74 -56 -67 -87 -36 -8 -100 -76 -88 -90 -45 -64 -25 -55 -15 -84 -67 -57 -73 -78 86 -28 -41 -63 -57"],["48","3 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2"]],[["100","-13 -43 -95 -61 -62 -94 -97 -48 -16 -88 -96 -74 -26 -58 -79 -44 -72 -22 -18 -66 -8 85 -98 -3 -36 -17 -80 -82 -77 -41 -24 -86 -62 -1 -22 -29 -30 -18 -25 -90 -66 -58 -86 -81 -34 -76 -67 -72 -77 -29 -66 -67 -34 3 -16 -90 -9 -14 -28 -60 -26 -99 75 -74 -94 -55 -54 -23 -30 -34 -4 -92 -88 -46 -52 -63 -98 -6 -89 -99 -80 -100 -97 -62 -70 -97 -75 -85 -22 -2 -32 -47 -85 -44 -23 -4 -21 -30 -6 -34"],["49","2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1"]],[["100","-5 -37 -22 -85 -63 -46 -44 -43 -23 -77 -75 -64 -84 -46 -78 -94 -67 -19 -5 -59 -32 -92 -10 -92 -58 -73 -72 -16 99 -58 -94 -49 -60 -3 -60 -74 -12 -8 -32 -94 -63 -53 -24 -29 -6 -46 -30 -32 -87 -41 -58 -70 -53 -20 -73 -42 -54 -5 -84 -45 -11 -9 -84 -7 -68 -100 -11 -2 -87 -27 -65 -45 -17 -33 -88 -55 90 -58 -89 -13 -66 -1 -46 -90 -69 -74 -84 -90 -50 -32 -62 -37 -44 -51 -25 -94 -73 -43 -1 -44"],["49","2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2"]],[["100","-76 -48 -63 -62 -94 -37 -54 -67 -9 -52 -83 -1 -87 -36 -94 -10 -19 -55 -93 -23 -2 -87 -15 -59 -60 -87 -63 -18 -62 -92 -10 -61 -12 -89 -85 -38 -37 -3 -71 -22 -94 -96 -100 -47 -20 -93 -28 77 -35 -74 -50 -72 -38 -29 -58 -80 -24 -9 -59 -4 -93 -65 -31 -47 -36 -13 -89 -96 -99 -83 -99 -36 -45 -58 -22 -93 -51 -26 -93 -36 -85 -72 -49 -27 -69 -29 -51 -84 -35 -26 -41 -43 -45 -87 -65 -100 -45 -69 -69 -73"],["50","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1"]],[["100","-77 -6 -71 -86 -42 -1 -40 -41 -31 -67 -75 -49 -62 -21 -2 -40 -2 -82 -90 -42 -43 -14 -72 -50 -33 -37 -58 -51 -67 -96 -63 -39 -56 -22 -17 -69 -88 -60 -18 -47 -16 -41 -32 -59 -82 -48 -22 -46 -29 -69 -21 -2 -41 -52 -83 -3 -49 -39 -31 -78 -60 -100 -12 -64 -28 -72 -43 -68 -60 -98 -21 -29 -72 -82 -5 -4 -65 -76 -60 -40 -37 -17 -77 -21 -19 -98 -39 -67 -49 -75 -7 -45 -11 -13 -45 -19 -83 -38 -14 -89"],["50","2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2"]],[["4","1 2 3 4"],["1","4"]],[["4","1 2 3 -4"],["1","4"]],[["4","-4 2 1 2"],["1","4"]],[["1","-1"],["1","1"]],[["2","2 -1"],["1","2"]],[["2","-100 100"],["1","2"]],[["3","-100 0 -100"],["1","3"]],[["5","1 2 3 -1 -1"],["1","5"]],[["5","-1 -1 2 3 4"],["1","5"]],[["3","-3 -4 -5"],["2","2 1"]],[["4","-3 -4 1 -3"],["2","3 1"]],[["1","-1"],["1","1"]],[["2","-1 0"],["1","2"]],[["4","0 0 0 0"],["1","4"]],[["3","-1 -1 -1"],["2","2 1"]],[["6","-1 -1 0 -1 -1 -1"],["3","3 2 1"]],[["2","0 0"],["1","2"]],[["6","0 0 -1 -1 -1 0"],["2","4 2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_153","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nlet maxn be an int const = 1e9 + 7\nlet INF be an int const = 0x3f3f3f3f\nlet maxx be a const int = 1e5\nin long long function poww that takes int a\n let k = 1, sum = 0 be both long long\n scale k by 2 for a times\n return k\nend of the block\ndefine the main function\n n, m = long long\n read n, m\n if n >= 35\n print m and new line\n else\n q = long long\n set q to poww with arg n\n print m mod q\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int maxn = 1e9 + 7;\nconst int INF = 0x3f3f3f3f;\nconst int maxx = 1e5;\nlong long poww(int a) {\n long long k = 1, sum = 0;\n for (int i = 0; i < a; i++) { k = k * 2; }\n return k;\n}\nint main() {\n long long n, m;\n cin >> n >> m;\n if (n >= 35) {\n cout << m << endl;\n } else {\n long long q;\n q = poww(n);\n cout << m % q << endl;\n }\n return 0;\n}","item":{"problem_id":"913A","pseudocode":"let maxn be an int const = 1e9 + 7\nlet INF be an int const = 0x3f3f3f3f\nlet maxx be a const int = 1e5\nin long long function poww that takes int a\n let k = 1, sum = 0 be both long long\n scale k by 2 for a times\n return k\nend of the block\ndefine the main function\n n, m = long long\n read n, m\n if n >= 35\n print m and new line\n else\n q = long long\n set q to poww with arg n\n print m mod q\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["4","42"],["10"]],[["1","58"],["0"]],[["98765432","23456789"],["23456789"]],[["8","88127381"],["149"]],[["32","92831989"],["92831989"]],[["92831989","25"],["25"]],[["100000000","100000000"],["100000000"]],[["7","1234"],["82"]],[["1","1"],["1"]],[["1","100000000"],["0"]],[["100000000","1"],["1"]],[["1","2"],["0"]],[["2","1"],["1"]],[["2","2"],["2"]],[["2","3"],["3"]],[["2","4"],["0"]],[["2","5"],["1"]],[["25","33554432"],["0"]],[["26","33554432"],["33554432"]],[["25","67108864"],["0"]],[["26","67108864"],["0"]],[["25","92831989"],["25723125"]],[["26","92831989"],["25723125"]],[["27","92831989"],["92831989"]],[["29","92831989"],["92831989"]],[["30","92831989"],["92831989"]],[["31","92831989"],["92831989"]],[["99812399","93172892"],["93172892"]],[["67108864","12345678"],["12345678"]],[["3","98391849"],["1"]],[["13","1231232"],["2432"]],[["18","9842194"],["142866"]],[["24","71237177"],["4128313"]],[["11","65535"],["2047"]],[["11","65536"],["0"]],[["12","123"],["123"]],[["123456","12"],["12"]],[["88","888"],["888"]],[["888","88"],["88"]],[["8888","8888"],["8888"]],[["64","128"],["128"]],[["128","64"],["64"]],[["60","9999999"],["9999999"]],[["200","100000"],["100000"]],[["3","8"],["0"]],[["10000000","25024886"],["25024886"]],[["100","100000"],["100000"]],[["99999999","100000000"],["100000000"]],[["70","12345678"],["12345678"]]]}} +{"instance_id":"pseudo_to_code_0.5k_154","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, sum = int\n num = int array of size 10 with values 2, 7, 2, 3, 3, 4, 2, 5, 1, 2\n loop while reading n\n if n < 10\n set sum to 2 * num[n]\n else\n set sum to num[n \/ 10] * num[n mod 10]\n end of the block\n print sum\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, sum;\n int num[10] = {2, 7, 2, 3, 3, 4, 2, 5, 1, 2};\n while (cin >> n) {\n if (n < 10) {\n sum = 2 * num[n];\n } else {\n sum = num[n \/ 10] * num[n % 10];\n }\n cout << sum << endl;\n }\n return 0;\n}","item":{"problem_id":"495A","pseudocode":"define the main function\n n, sum = int\n num = int array of size 10 with values 2, 7, 2, 3, 3, 4, 2, 5, 1, 2\n loop while reading n\n if n < 10\n set sum to 2 * num[n]\n else\n set sum to num[n \/ 10] * num[n mod 10]\n end of the block\n print sum\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["89"],["2"]],[["00"],["4"]],[["73"],["15"]],[["08"],["2"]],[["26"],["4"]],[["49"],["6"]],[["88"],["1"]],[["04"],["6"]],[["60"],["4"]],[["11"],["49"]],[["22"],["4"]],[["33"],["9"]],[["44"],["9"]],[["55"],["16"]],[["66"],["4"]],[["77"],["25"]],[["88"],["1"]],[["99"],["4"]],[["80"],["2"]],[["78"],["5"]],[["67"],["10"]],[["89"],["2"]],[["46"],["6"]],[["90"],["4"]],[["92"],["4"]],[["35"],["12"]],[["05"],["8"]],[["57"],["20"]],[["20"],["4"]]]}} +{"instance_id":"pseudo_to_code_0.5k_155","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create new integer variable n\n read n from the user input\n print n % 2\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n cout << n % 2 << endl;\n}","item":{"problem_id":"952A","pseudocode":"define the main function\n create new integer variable n\n read n from the user input\n print n % 2\nend of the block","testcases":[[["13"],["1"]],[["927"],["1"]],[["48"],["0"]],[["10"],["0"]],[["999"],["1"]],[["142"],["0"]],[["309"],["1"]],[["572"],["0"]],[["835"],["1"]],[["990"],["0"]],[["168"],["0"]],[["431"],["1"]],[["694"],["0"]],[["957"],["1"]],[["932"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_156","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nlet INF be const integer with INF = 0x3f3f3f3f\ndefine the main function\n let n, m be integers\n read n, m\n let ans, ar be array of size 105 by 105 with ans = ar = {0}\n for i = 1 to n inclusive\n for j = 1 to m inclusive\n read ans[i][j]\n set ar[i][j] to ans[i][j]\n end of the block\n let mins, sum be integers with mins = INF and sum = 0\n let temp be integer array of size 6 by 200 with temp = {0}\n for i = 1 to n inclusive\n set mins to INF\n for j = 1 to m inclusive, set mins to min of mins, ans[i][j]\n set temp[1][i] to mins\n for j = 1 to m inclusive, set ans[i][j] to ans[i][j] - mins\n end of the block\n for j = 1 to m inclusive\n set mins to INF\n for i = 1 to n inclusive, set mins to min of mins, ans[i][j]\n set temp[2][j] to mins\n for i = 1 to n inclusive, decrement ans[i][j] by mins\n end of the block\n for j = 1 to m inclusive\n set mins to INF\n for i = 1 to n inclusive, set mins to min of mins, ar[i][j]\n set temp[3][j] to mins\n for i = 1 to n inclusive, set ar[i][j] to ar[i][j] - mins\n end of the block\n for i = 1 to n inclusive\n set mins to iNF\n for j = 1 to m inclusive, mins = min of mins, ar[i][j]\n temp[4][i] = mins\n for j = 1 to m inclusive, decrement ar[i][j] by mins\n end of the block\n let flag1, flag2 be integers with flag1 = flag2 = 0\n for i = 1 to n inclusive\n for j = 1 to m inclusive\n if ans[i][j] != 0\n set flag1 to 1\n break\n end of the block\n end of the block\n end of the block\n for i = 1 to n inclusive\n for j = 1 to m inclusive\n if ar[i][j] != 0\n set flag2 to 0\n break\n end of the block\n end of the block\n end of the block\n if flag1 == 1 and flag2 == 1\n print -1\n else if flag1 == 0 and flag2 == 0\n sum1 = sum2 = integer = 0\n for i = 1 to n inclusive\n increment sum1 by temp[1][i]\n increment sum2 by temp[4][i]\n end of the block\n for j = 1 to m inclusive\n increment sum1 by temp[2][j]\n increment sum2 by temp[3][j]\n end of the block\n if sum1 > sum2\n print sum2\n for i = 1 to n inclusive\n for j = 1 to temp[4][i], print row, i\n for j = 1 to m inclusive\n for i = 1 to temp[3][j] inclusive, print col, j\n else\n print sum1\n for i = 1 to n inclusive\n for j = 1 to temp[1][i], print \"row \", i\n for j = 1 to m inclusive\n for i = 1 to temp[2][j] inclusive, print \"col \", j\n end of the block\n else if flag1 == 1\n let sum2 be integer with sum2 = 0\n for i = 1 to n inclusive, increment sum2 by temp[4][i]\n for j = 1 to n inclusive, increment sum2 by temp[3][j]\n print sum2\n for i = 1 to n inclusive\n for j = 1 to temp[4][i] inclusive, print \"row \", i\n for j = 1 to m inclusive\n for i = 1 to temp[3][j] inclusive, print \"col \", j\n else if flag2 == 1\n sum1 = int = 0\n for i = 1 to n inclusive, increment sum1 by temp[4][i]\n for j = 1 to n inclusive, increment sum1 by temp[3][j]\n print sum1\n for i = 1 to n inclusive\n for j = 1 to temp[1][i] inclusive, print \"row \", i\n for j = 1 to m inclusive\n for i = 1 to temp[2][j] inclusive, print \"col \", j\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int INF = 0x3f3f3f3f;\nint main() {\n int n, m;\n cin >> n >> m;\n int ans[105][105] = {0}, ar[105][105] = {0};\n for (int i = 1; i <= n; i++)\n for (int j = 1; j <= m; j++) {\n cin >> ans[i][j];\n ar[i][j] = ans[i][j];\n }\n int mins = INF, sum = 0;\n int temp[6][200] = {0};\n for (int i = 1; i <= n; i++) {\n mins = INF;\n for (int j = 1; j <= m; j++) mins = min(mins, ans[i][j]);\n temp[1][i] = mins;\n for (int j = 1; j <= m; j++) ans[i][j] -= mins;\n }\n for (int j = 1; j <= m; j++) {\n mins = INF;\n for (int i = 1; i <= n; i++) mins = min(mins, ans[i][j]);\n temp[2][j] = mins;\n for (int i = 1; i <= n; i++) ans[i][j] -= mins;\n }\n for (int j = 1; j <= m; j++) {\n mins = INF;\n for (int i = 1; i <= n; i++) mins = min(mins, ar[i][j]);\n temp[3][j] = mins;\n for (int i = 1; i <= n; i++) ar[i][j] -= mins;\n }\n for (int i = 1; i <= n; i++) {\n mins = INF;\n for (int j = 1; j <= m; j++) mins = min(mins, ar[i][j]);\n temp[4][i] = mins;\n for (int j = 1; j <= m; j++) ar[i][j] -= mins;\n }\n int flag1 = 0, flag2 = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= m; j++) {\n if (ans[i][j] != 0) {\n flag1 = 1;\n break;\n }\n }\n }\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= m; j++) {\n if (ar[i][j] != 0) {\n flag2 = 1;\n break;\n }\n }\n }\n if (flag1 == 1 && flag2 == 1)\n cout << -1 << endl;\n else if (flag1 == 0 && flag2 == 0) {\n int sum1 = 0, sum2 = 0;\n for (int i = 1; i <= n; i++) {\n sum1 += temp[1][i];\n sum2 += temp[4][i];\n }\n for (int j = 1; j <= m; j++) {\n sum1 += temp[2][j];\n sum2 += temp[3][j];\n }\n if (sum1 > sum2) {\n cout << sum2 << endl;\n for (int i = 1; i <= n; i++)\n for (int j = 1; j <= temp[4][i]; j++) cout << \"row \" << i << endl;\n for (int j = 1; j <= m; j++)\n for (int i = 1; i <= temp[3][j]; i++) cout << \"col \" << j << endl;\n } else {\n cout << sum1 << endl;\n for (int i = 1; i <= n; i++)\n for (int j = 1; j <= temp[1][i]; j++) cout << \"row \" << i << endl;\n for (int j = 1; j <= m; j++)\n for (int i = 1; i <= temp[2][j]; i++) cout << \"col \" << j << endl;\n }\n } else if (flag1 == 1) {\n int sum2 = 0;\n for (int i = 1; i <= n; i++) { sum2 += temp[4][i]; }\n for (int j = 1; j <= m; j++) { sum2 += temp[3][j]; }\n cout << sum2 << endl;\n for (int i = 1; i <= n; i++)\n for (int j = 1; j <= temp[4][i]; j++) cout << \"row \" << i << endl;\n for (int j = 1; j <= m; j++)\n for (int i = 1; i <= temp[3][j]; i++) cout << \"col \" << j << endl;\n } else if (flag2 == 1) {\n int sum1 = 0;\n for (int i = 1; i <= n; i++) { sum1 += temp[4][i]; }\n for (int j = 1; j <= m; j++) { sum1 += temp[3][j]; }\n cout << sum1 << endl;\n for (int i = 1; i <= n; i++)\n for (int j = 1; j <= temp[1][i]; j++) cout << \"row \" << i << endl;\n for (int j = 1; j <= m; j++)\n for (int i = 1; i <= temp[2][j]; i++) cout << \"col \" << j << endl;\n }\n return 0;\n}","item":{"problem_id":"815A","pseudocode":"let INF be const integer with INF = 0x3f3f3f3f\ndefine the main function\n let n, m be integers\n read n, m\n let ans, ar be array of size 105 by 105 with ans = ar = {0}\n for i = 1 to n inclusive\n for j = 1 to m inclusive\n read ans[i][j]\n set ar[i][j] to ans[i][j]\n end of the block\n let mins, sum be integers with mins = INF and sum = 0\n let temp be integer array of size 6 by 200 with temp = {0}\n for i = 1 to n inclusive\n set mins to INF\n for j = 1 to m inclusive, set mins to min of mins, ans[i][j]\n set temp[1][i] to mins\n for j = 1 to m inclusive, set ans[i][j] to ans[i][j] - mins\n end of the block\n for j = 1 to m inclusive\n set mins to INF\n for i = 1 to n inclusive, set mins to min of mins, ans[i][j]\n set temp[2][j] to mins\n for i = 1 to n inclusive, decrement ans[i][j] by mins\n end of the block\n for j = 1 to m inclusive\n set mins to INF\n for i = 1 to n inclusive, set mins to min of mins, ar[i][j]\n set temp[3][j] to mins\n for i = 1 to n inclusive, set ar[i][j] to ar[i][j] - mins\n end of the block\n for i = 1 to n inclusive\n set mins to iNF\n for j = 1 to m inclusive, mins = min of mins, ar[i][j]\n temp[4][i] = mins\n for j = 1 to m inclusive, decrement ar[i][j] by mins\n end of the block\n let flag1, flag2 be integers with flag1 = flag2 = 0\n for i = 1 to n inclusive\n for j = 1 to m inclusive\n if ans[i][j] != 0\n set flag1 to 1\n break\n end of the block\n end of the block\n end of the block\n for i = 1 to n inclusive\n for j = 1 to m inclusive\n if ar[i][j] != 0\n set flag2 to 0\n break\n end of the block\n end of the block\n end of the block\n if flag1 == 1 and flag2 == 1\n print -1\n else if flag1 == 0 and flag2 == 0\n sum1 = sum2 = integer = 0\n for i = 1 to n inclusive\n increment sum1 by temp[1][i]\n increment sum2 by temp[4][i]\n end of the block\n for j = 1 to m inclusive\n increment sum1 by temp[2][j]\n increment sum2 by temp[3][j]\n end of the block\n if sum1 > sum2\n print sum2\n for i = 1 to n inclusive\n for j = 1 to temp[4][i], print row, i\n for j = 1 to m inclusive\n for i = 1 to temp[3][j] inclusive, print col, j\n else\n print sum1\n for i = 1 to n inclusive\n for j = 1 to temp[1][i], print \"row \", i\n for j = 1 to m inclusive\n for i = 1 to temp[2][j] inclusive, print \"col \", j\n end of the block\n else if flag1 == 1\n let sum2 be integer with sum2 = 0\n for i = 1 to n inclusive, increment sum2 by temp[4][i]\n for j = 1 to n inclusive, increment sum2 by temp[3][j]\n print sum2\n for i = 1 to n inclusive\n for j = 1 to temp[4][i] inclusive, print \"row \", i\n for j = 1 to m inclusive\n for i = 1 to temp[3][j] inclusive, print \"col \", j\n else if flag2 == 1\n sum1 = int = 0\n for i = 1 to n inclusive, increment sum1 by temp[4][i]\n for j = 1 to n inclusive, increment sum1 by temp[3][j]\n print sum1\n for i = 1 to n inclusive\n for j = 1 to temp[1][i] inclusive, print \"row \", i\n for j = 1 to m inclusive\n for i = 1 to temp[2][j] inclusive, print \"col \", j\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["3 5","2 2 2 3 2","0 0 0 1 0","1 1 1 2 1"],["4","row 1","row 1","row 3","col 4"]],[["3 3","0 0 0","0 1 0","0 0 0"],["-1"]],[["3 3","1 1 1","1 1 1","1 1 1"],["3","row 1","row 2","row 3"]],[["3 5","2 4 2 2 3","0 2 0 0 1","1 3 1 1 2"],["6","row 1","row 1","row 3","col 2","col 2","col 5"]],[["3 5","0 0 0 0 0","0 0 0 0 0","0 0 0 0 1"],["-1"]],[["1 1","0"],["0"]],[["10 10","1 1 1 1 1 1 1 1 1 1","1 1 1 1 1 1 1 1 1 1","1 1 1 1 1 1 1 1 1 1","1 1 1 1 1 1 1 1 1 1","0 0 0 0 0 0 0 0 0 0","1 1 1 1 1 1 1 1 1 1","1 1 1 1 1 1 1 1 1 1","1 1 1 1 1 1 1 1 1 1","1 1 1 1 1 1 1 1 1 1","1 1 1 1 1 1 1 1 1 1"],["9","row 1","row 2","row 3","row 4","row 6","row 7","row 8","row 9","row 10"]],[["10 10","1 1 1 1 1 1 0 1 1 1","1 1 1 1 1 1 0 1 1 1","1 1 1 1 1 1 0 1 1 1","1 1 1 1 1 1 0 1 1 1","1 1 1 1 1 1 0 1 1 1","1 1 1 1 1 1 0 1 1 1","1 1 1 1 1 1 0 1 1 1","1 1 1 1 1 1 0 1 1 1","1 1 1 1 1 1 0 1 1 1","1 1 1 1 1 1 0 1 1 1"],["9","col 1","col 2","col 3","col 4","col 5","col 6","col 8","col 9","col 10"]],[["5 3","2 2 2","2 2 2","2 2 2","1 1 1","2 2 2"],["7","row 1","row 2","row 3","row 5","col 1","col 2","col 3"]],[["3 5","2 2 2 1 2","2 2 2 1 2","2 2 2 1 2"],["7","row 1","row 2","row 3","col 1","col 2","col 3","col 5"]],[["1 100","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 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 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 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"],["0"]],[["100 1","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","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","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","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"],["0"]],[["1 100","1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"],["1","row 1"]],[["100 1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1"],["1","col 1"]],[["2 1","1","1"],["1","col 1"]],[["4 3","1 1 1","1 1 1","1 1 1","1 1 1"],["3","col 1","col 2","col 3"]],[["2 1","2","2"],["2","col 1","col 1"]],[["3 2","1 1","1 1","1 1"],["2","col 1","col 2"]],[["2 1","1","2"],["2","row 2","col 1"]],[["2 3","1 1 1","1 1 1"],["2","row 1","row 2"]],[["1 2","1 1"],["1","row 1"]],[["5 1","1","1","1","1","1"],["1","col 1"]],[["2 1","10","10"],["10","col 1","col 1","col 1","col 1","col 1","col 1","col 1","col 1","col 1","col 1"]],[["4 3","2 2 2","2 2 2","2 2 2","2 2 2"],["6","col 1","col 1","col 2","col 2","col 3","col 3"]],[["3 1","1","1","1"],["1","col 1"]],[["8 2","2 2","2 2","2 2","2 2","2 2","2 2","2 2","2 2"],["4","col 1","col 1","col 2","col 2"]],[["1 2","2 2"],["2","row 1","row 1"]],[["3 2","2 3","2 3","2 3"],["5","col 1","col 1","col 2","col 2","col 2"]],[["2 1","3","3"],["3","col 1","col 1","col 1"]],[["6 2","1 1","1 1","1 1","1 1","1 1","1 1"],["2","col 1","col 2"]],[["4 1","1","1","1","1"],["1","col 1"]],[["2 5","1 1 1 1 1","1 1 1 1 1"],["2","row 1","row 2"]],[["5 2","1 1","2 2","2 2","2 2","2 2"],["6","row 2","row 3","row 4","row 5","col 1","col 2"]],[["4 3","3 3 3","3 3 3","3 3 3","3 3 3"],["9","col 1","col 1","col 1","col 2","col 2","col 2","col 3","col 3","col 3"]],[["5 2","1 1","1 1","1 1","1 1","1 1"],["2","col 1","col 2"]],[["1 4","1 1 1 1"],["1","row 1"]],[["3 1","2","3","2"],["3","row 2","col 1","col 1"]],[["1 5","1 1 1 1 1"],["1","row 1"]],[["2 4","3 1 1 1","3 1 1 1"],["4","row 1","row 2","col 1","col 1"]],[["3 3","1 1 1","0 1 0","0 0 0"],["-1"]],[["3 2","2 2","1 1","2 2"],["4","row 1","row 3","col 1","col 2"]],[["2 1","9","9"],["9","col 1","col 1","col 1","col 1","col 1","col 1","col 1","col 1","col 1"]],[["1 7","3 3 3 3 3 3 3"],["3","row 1","row 1","row 1"]],[["5 2","3 3","3 3","3 3","3 3","3 3"],["6","col 1","col 1","col 1","col 2","col 2","col 2"]],[["7 1","1","1","1","1","1","1","1"],["1","col 1"]],[["5 3","1 1 1","1 1 1","1 1 1","1 1 1","1 1 1"],["3","col 1","col 2","col 3"]],[["5 3","3 3 3","3 3 3","3 3 3","3 3 3","3 3 3"],["9","col 1","col 1","col 1","col 2","col 2","col 2","col 3","col 3","col 3"]],[["2 1","4","5"],["5","row 2","col 1","col 1","col 1","col 1"]],[["4 2","3 3","3 3","3 3","3 3"],["6","col 1","col 1","col 1","col 2","col 2","col 2"]],[["6 3","2 2 2","1 1 1","1 1 1","1 1 1","1 1 1","1 1 1"],["4","row 1","col 1","col 2","col 3"]],[["5 1","1","2","3","4","5"],["11","row 2","row 3","row 3","row 4","row 4","row 4","row 5","row 5","row 5","row 5","col 1"]],[["2 1","1","3"],["3","row 2","row 2","col 1"]],[["10 1","1","1","1","1","1","1","1","1","1","1"],["1","col 1"]],[["6 2","2 2","2 2","2 2","2 2","2 2","2 2"],["4","col 1","col 1","col 2","col 2"]],[["3 5","1 1 1 1 1","1 1 1 1 1","1 1 1 1 1"],["3","row 1","row 2","row 3"]],[["2 3","2 1 2","2 1 2"],["4","row 1","row 2","col 1","col 3"]],[["5 2","2 2","2 2","2 2","2 2","2 2"],["4","col 1","col 1","col 2","col 2"]],[["1 2","1 3"],["3","row 1","col 2","col 2"]],[["4 3","2 2 2","1 1 1","1 1 1","1 1 1"],["4","row 1","col 1","col 2","col 3"]],[["3 2","1 1","2 2","3 3"],["5","row 2","row 3","row 3","col 1","col 2"]],[["4 2","1 1","1 1","1 1","1 1"],["2","col 1","col 2"]],[["3 4","1 1 1 1","1 1 1 1","1 1 1 1"],["3","row 1","row 2","row 3"]],[["2 1","2","3"],["3","row 2","col 1","col 1"]],[["5 3","2 2 2","2 2 2","2 2 2","2 2 2","2 2 2"],["6","col 1","col 1","col 2","col 2","col 3","col 3"]],[["3 2","1 0","2 1","2 1"],["3","row 2","row 3","col 1"]],[["3 2","1 2","2 3","3 4"],["6","row 2","row 3","row 3","col 1","col 2","col 2"]],[["3 3","1 1 1","1 2 1","1 1 1"],["-1"]],[["4 3","2 1 1","2 1 1","2 1 1","2 1 1"],["4","col 1","col 1","col 2","col 3"]],[["4 1","3","3","3","3"],["3","col 1","col 1","col 1"]],[["1 3","2 3 2"],["3","row 1","row 1","col 2"]],[["1 2","1 2"],["2","row 1","col 2"]],[["3 2","2 2","2 2","2 2"],["4","col 1","col 1","col 2","col 2"]],[["1 3","1 1 1"],["1","row 1"]],[["6 3","1 1 1","1 1 1","1 1 1","1 1 1","1 1 1","1 1 1"],["3","col 1","col 2","col 3"]],[["3 1","2","2","2"],["2","col 1","col 1"]],[["3 1","3","3","3"],["3","col 1","col 1","col 1"]],[["3 2","2 2","1 1","1 1"],["3","row 1","col 1","col 2"]],[["5 3","1 1 2","1 1 2","1 1 2","1 1 2","1 1 2"],["4","col 1","col 2","col 3","col 3"]],[["1 2","2 3"],["3","row 1","row 1","col 2"]],[["5 1","2","2","2","2","2"],["2","col 1","col 1"]],[["3 2","1 1","2 2","2 2"],["4","row 2","row 3","col 1","col 2"]],[["3 3","1 1 1","2 3 3","4 4 4"],["-1"]],[["2 1","5","2"],["5","row 1","row 1","row 1","col 1","col 1"]],[["4 2","2 2","2 2","2 2","2 2"],["4","col 1","col 1","col 2","col 2"]],[["3 2","5 10","5 10","5 10"],["15","col 1","col 1","col 1","col 1","col 1","col 2","col 2","col 2","col 2","col 2","col 2","col 2","col 2","col 2","col 2"]],[["4 3","3 4 3","5 6 5","3 4 3","3 4 3"],["12","row 2","row 2","col 1","col 1","col 1","col 2","col 2","col 2","col 2","col 3","col 3","col 3"]],[["4 2","1 1","1 1","1 1","2 2"],["3","row 4","col 1","col 2"]],[["4 1","4","4","4","4"],["4","col 1","col 1","col 1","col 1"]],[["3 2","1 1","1 1","2 2"],["3","row 3","col 1","col 2"]],[["2 3","2 2 2","2 2 2"],["4","row 1","row 1","row 2","row 2"]],[["3 2","3 3","3 3","3 3"],["6","col 1","col 1","col 1","col 2","col 2","col 2"]],[["2 3","10 10 10","5 5 5"],["15","row 1","row 1","row 1","row 1","row 1","row 1","row 1","row 1","row 1","row 1","row 2","row 2","row 2","row 2","row 2"]],[["5 2","1 2","1 2","1 2","1 2","1 2"],["3","col 1","col 2","col 2"]],[["2 1","5","5"],["5","col 1","col 1","col 1","col 1","col 1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_157","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare long longs n, m, res, long long arrays a size 1010, c size 1010\ndefine the main function\n read n, m\n for i = 1 to n inclusive, read c[i]\n for i = 1 to m inclusive, read a[i]\n declare long long neo = 1\n for i = 1 to m inclusive\n while neo is less than n and a[i] is less than c[neo], increment neo\n if c[neo] is less than or equal to a[i]\n increment res\n increment neo\n else\n end loop\n if neo is greater than n, end loop\n end of the block\n print res and newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"long long n, m, a[1010], c[1010], res;\nint main() {\n cin >> n >> m;\n for (int i = 1; i <= n; i++) cin >> c[i];\n for (int i = 1; i <= m; i++) cin >> a[i];\n long long neo = 1;\n for (int i = 1; i <= m; i++) {\n while (neo < n && a[i] < c[neo]) neo++;\n if (c[neo] <= a[i]) {\n res++;\n neo++;\n } else\n break;\n if (neo > n) break;\n }\n cout << res << endl;\n return 0;\n}","item":{"problem_id":"1009A","pseudocode":"declare long longs n, m, res, long long arrays a size 1010, c size 1010\ndefine the main function\n read n, m\n for i = 1 to n inclusive, read c[i]\n for i = 1 to m inclusive, read a[i]\n declare long long neo = 1\n for i = 1 to m inclusive\n while neo is less than n and a[i] is less than c[neo], increment neo\n if c[neo] is less than or equal to a[i]\n increment res\n increment neo\n else\n end loop\n if neo is greater than n, end loop\n end of the block\n print res and newline\n return to indicate successful execution\nend of the block","testcases":[[["5 4","2 4 5 2 4","5 3 4 6"],["3"]],[["5 2","20 40 50 20 40","19 20"],["0"]],[["6 4","4 8 15 16 23 42","1000 1000 1000 1000"],["4"]],[["5 1","1 1 1 1 1","5"],["1"]],[["5 1","10 1 1 1 1","1000"],["1"]],[["5 1","100 100 100 100 100","100"],["1"]],[["2 1","2 1","1"],["1"]],[["2 3","3 1","2 4 2"],["1"]],[["1 5","4","1 4 3 3 2"],["0"]],[["5 3","4 2 3 1 1","2 1 3"],["3"]],[["3 5","5 2 5","1 4 1 4 2"],["0"]],[["7 3","9 7 10 2 1 1 1","8 9 6"],["3"]],[["5 3","2 5 3 3 2","2 5 3"],["3"]]]}} +{"instance_id":"pseudo_to_code_0.5k_158","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create string str\n create integer array freq with size 26\n for i = 0 to 26 exclusive, set freq[i] to 0\n read str\n for i = 0 to size of str exclusive, increment freq[str[i]-'a']\n create integer sum with sum = 0\n for i = 0 to 26 exclusive\n if freq[i] is greater than 0, increment sum\n end of the block\n if sum % 2 is 0\n print \"CHAT WITH HER!\" print newline\n else\n print \"IGNORE HIM!\" print newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string str;\n int freq[26];\n for (int i = 0; i < 26; i++) freq[i] = 0;\n cin >> str;\n for (int i = 0; i < str.size(); i++) ++freq[str[i] - 'a'];\n int sum = 0;\n for (int i = 0; i < 26; i++) {\n if (freq[i] > 0) sum++;\n }\n if (sum % 2 == 0)\n cout << \"CHAT WITH HER!\" << endl;\n else\n cout << \"IGNORE HIM!\" << endl;\n return 0;\n}","item":{"problem_id":"236A","pseudocode":"define the main function\n create string str\n create integer array freq with size 26\n for i = 0 to 26 exclusive, set freq[i] to 0\n read str\n for i = 0 to size of str exclusive, increment freq[str[i]-'a']\n create integer sum with sum = 0\n for i = 0 to 26 exclusive\n if freq[i] is greater than 0, increment sum\n end of the block\n if sum % 2 is 0\n print \"CHAT WITH HER!\" print newline\n else\n print \"IGNORE HIM!\" print newline\n return to indicate successful execution\nend of the block","testcases":[[["wjmzbmr"],["CHAT WITH HER!"]],[["xiaodao"],["IGNORE HIM!"]],[["sevenkplus"],["CHAT WITH HER!"]],[["pezu"],["CHAT WITH HER!"]],[["wnemlgppy"],["CHAT WITH HER!"]],[["zcinitufxoldnokacdvtmdohsfdjepyfioyvclhmujiqwvmudbfjzxjfqqxjmoiyxrfsbvseawwoyynn"],["IGNORE HIM!"]],[["qsxxuoynwtebujwpxwpajitiwxaxwgbcylxneqiebzfphugwkftpaikixmumkhfbjiswmvzbtiyifbx"],["CHAT WITH HER!"]],[["qwbdfzfylckctudyjlyrtmvbidfatdoqfmrfshsqqmhzohhsczscvwzpwyoyswhktjlykumhvaounpzwpxcspxwlgt"],["IGNORE HIM!"]],[["nuezoadauueermoeaabjrkxttkatspjsjegjcjcdmcxgodowzbwuqncfbeqlhkk"],["IGNORE HIM!"]],[["lggvdmulrsvtuagoavstuyufhypdxfomjlzpnduulukszqnnwfvxbvxyzmleocmofwclmzz"],["IGNORE HIM!"]],[["tgcdptnkc"],["IGNORE HIM!"]],[["wvfgnfrzabgibzxhzsojskmnlmrokydjoexnvi"],["IGNORE HIM!"]],[["sxtburpzskucowowebgrbovhadrrayamuwypmmxhscrujkmcgvyinp"],["IGNORE HIM!"]],[["pjqxhvxkyeqqvyuujxhmbspatvrckhhkfloottuybjivkkhpyivcighxumavrxzxslfpggnwbtalmhysyfllznphzia"],["IGNORE HIM!"]],[["fpellxwskyekoyvrfnuf"],["CHAT WITH HER!"]],[["xninyvkuvakfbs"],["IGNORE HIM!"]],[["vnxhrweyvhqufpfywdwftoyrfgrhxuamqhblkvdpxmgvphcbeeqbqssresjifwyzgfhurmamhkwupymuomak"],["CHAT WITH HER!"]],[["kmsk"],["IGNORE HIM!"]],[["lqonogasrkzhryjxppjyriyfxmdfubieglthyswz"],["CHAT WITH HER!"]],[["ndormkufcrkxlihdhmcehzoimcfhqsmombnfjrlcalffq"],["CHAT WITH HER!"]],[["zqzlnnuwcfufwujygtczfakhcpqbtxtejrbgoodychepzdphdahtxyfpmlrycyicqthsgm"],["IGNORE HIM!"]],[["ppcpbnhwoizajrl"],["IGNORE HIM!"]],[["sgubujztzwkzvztitssxxxwzanfmddfqvv"],["CHAT WITH HER!"]],[["ptkyaxycecpbrjnvxcjtbqiocqcswnmicxbvhdsptbxyxswbw"],["IGNORE HIM!"]],[["yhbtzfppwcycxqjpqdfmjnhwaogyuaxamwxpnrdrnqsgdyfvxu"],["CHAT WITH HER!"]],[["ojjvpnkrxibyevxk"],["CHAT WITH HER!"]],[["wjweqcrqfuollfvfbiyriijovweg"],["IGNORE HIM!"]],[["hkdbykboclchfdsuovvpknwqr"],["IGNORE HIM!"]],[["stjvyfrfowopwfjdveduedqylerqugykyu"],["IGNORE HIM!"]],[["rafcaanqytfclvfdegak"],["CHAT WITH HER!"]],[["xczn"],["CHAT WITH HER!"]],[["arcoaeozyeawbveoxpmafxxzdjldsielp"],["IGNORE HIM!"]],[["smdfafbyehdylhaleevhoggiurdgeleaxkeqdixyfztkuqsculgslheqfafxyghyuibdgiuwrdxfcitojxika"],["CHAT WITH HER!"]],[["vbpfgjqnhfazmvtkpjrdasfhsuxnpiepxfrzvoh"],["CHAT WITH HER!"]],[["dbdokywnpqnotfrhdbrzmuyoxfdtrgrzcccninbtmoqvxfatcqg"],["CHAT WITH HER!"]],[["udlpagtpq"],["CHAT WITH HER!"]],[["zjurevbytijifnpfuyswfchdzelxheboruwjqijxcucylysmwtiqsqqhktexcynquvcwhbjsipy"],["CHAT WITH HER!"]],[["qagzrqjomdwhagkhrjahhxkieijyten"],["CHAT WITH HER!"]],[["achhcfjnnfwgoufxamcqrsontgjjhgyfzuhklkmiwybnrlsvblnsrjqdytglipxsulpnphpjpoewvlusalsgovwnsngb"],["CHAT WITH HER!"]],[["qbkjsdwpahdbbohggbclfcufqelnojoehsxxkr"],["CHAT WITH HER!"]],[["cpvftiwgyvnlmbkadiafddpgfpvhqqvuehkypqjsoibpiudfvpkhzlfrykc"],["IGNORE HIM!"]],[["lnpdosnceumubvk"],["IGNORE HIM!"]],[["efrk"],["CHAT WITH HER!"]],[["temnownneghnrujforif"],["IGNORE HIM!"]],[["ottnneymszwbumgobazfjyxewkjakglbfflsajuzescplpcxqta"],["IGNORE HIM!"]],[["eswpaclodzcwhgixhpyzvhdwsgneqidanbzdzszquefh"],["IGNORE HIM!"]],[["gwntwbpj"],["IGNORE HIM!"]],[["wuqvlbblkddeindiiswsinkfrnkxghhwunzmmvyovpqapdfbolyim"],["IGNORE HIM!"]],[["swdqsnzmzmsyvktukaoyqsqzgfmbzhezbfaqeywgwizrwjyzquaahucjchegknqaioliqd"],["CHAT WITH HER!"]],[["vlhrpzezawyolhbmvxbwhtjustdbqggexmzxyieihjlelvwjosmkwesfjmramsikhkupzvfgezmrqzudjcalpjacmhykhgfhrjx"],["IGNORE HIM!"]],[["lxxwbkrjgnqjwsnflfnsdyxihmlspgivirazsbveztnkuzpaxtygidniflyjheejelnjyjvgkgvdqks"],["CHAT WITH HER!"]],[["wpxbxzfhtdecetpljcrvpjjnllosdqirnkzesiqeukbedkayqx"],["CHAT WITH HER!"]],[["vmzxgacicvweclaodrunmjnfwtimceetsaoickarqyrkdghcmyjgmtgsqastcktyrjgvjqimdc"],["CHAT WITH HER!"]],[["yzlzmesxdttfcztooypjztlgxwcr"],["IGNORE HIM!"]],[["qpbjwzwgdzmeluheirjrvzrhbmagfsjdgvzgwumjtjzecsfkrfqjasssrhhtgdqqfydlmrktlgfc"],["IGNORE HIM!"]],[["aqzftsvezdgouyrirsxpbuvdjupnzvbhguyayeqozfzymfnepvwgblqzvmxxkxcilmsjvcgyqykpoaktjvsxbygfgsalbjoq"],["CHAT WITH HER!"]],[["znicjjgijhrbdlnwmtjgtdgziollrfxroabfhadygnomodaembllreorlyhnehijfyjbfxucazellblegyfrzuraogadj"],["IGNORE HIM!"]],[["qordzrdiknsympdrkgapjxokbldorpnmnpucmwakklmqenpmkom"],["CHAT WITH HER!"]],[["wqfldgihuxfktzanyycluzhtewmwvnawqlfoavuguhygqrrxtstxwouuzzsryjqtfqo"],["CHAT WITH HER!"]],[["vujtrrpshinkskgyknlcfckmqdrwtklkzlyipmetjvaqxdsslkskschbalmdhzsdrrjmxdltbtnxbh"],["IGNORE HIM!"]],[["zioixjibuhrzyrbzqcdjbbhhdmpgmqykixcxoqupggaqajuzonrpzihbsogjfsrrypbiphehonyhohsbybnnukqebopppa"],["CHAT WITH HER!"]],[["oh"],["CHAT WITH HER!"]],[["kxqthadqesbpgpsvpbcbznxpecqrzjoilpauttzlnxvaczcqwuri"],["IGNORE HIM!"]],[["zwlunigqnhrwirkvufqwrnwcnkqqonebrwzcshcbqqwkjxhymjjeakuzjettebciadjlkbfp"],["CHAT WITH HER!"]],[["fjuldpuejgmggvvigkwdyzytfxzwdlofrpifqpdnhfyroginqaufwgjcbgshyyruwhofctsdaisqpjxqjmtpp"],["CHAT WITH HER!"]],[["xiwntnheuitbtqxrmzvxmieldudakogealwrpygbxsbluhsqhtwmdlpjwzyafckrqrdduonkgo"],["CHAT WITH HER!"]],[["mnmbupgo"],["IGNORE HIM!"]],[["mcjehdiygkbmrbfjqwpwxidbdfelifwhstaxdapigbymmsgrhnzsdjhsqchl"],["IGNORE HIM!"]],[["yocxrzspinchmhtmqo"],["CHAT WITH HER!"]],[["vasvvnpymtgjirnzuynluluvmgpquskuaafwogeztfnvybblajvuuvfomtifeuzpikjrolzeeoftv"],["CHAT WITH HER!"]],[["ecsdicrznvglwggrdbrvehwzaenzjutjydhvimtqegweurpxtjkmpcznshtrvotkvrghxhacjkedidqqzrduzad"],["IGNORE HIM!"]],[["ubvhyaebyxoghakajqrpqpctwbrfqzli"],["CHAT WITH HER!"]],[["gogbxfeqylxoummvgxpkoqzsmobasesxbqjjktqbwqxeiaagnnhbvepbpy"],["IGNORE HIM!"]],[["nheihhxkbbrmlpxpxbhnpofcjmxemyvqqdbanwd"],["IGNORE HIM!"]],[["acrzbavz"],["CHAT WITH HER!"]],[["drvzznznvrzskftnrhvvzxcalwutxmdza"],["IGNORE HIM!"]],[["oacwxipdfcoabhkwxqdbtowiekpnflnqhlrkustgzryvws"],["CHAT WITH HER!"]],[["tpnwfmfsibnccvdwjvzviyvjfljupinfigfunyff"],["CHAT WITH HER!"]],[["gavaihhamfolcndgytcsgucqdqngxkrlovpthvteacmmthoglxu"],["CHAT WITH HER!"]],[["hsfcfvameeupldgvchmogrvwxrvsmnwxxkxoawwodtsahqvehlcw"],["IGNORE HIM!"]],[["sbkydrscoojychxchqsuciperfroumenelgiyiwlqfwximrgdbyvkmacy"],["CHAT WITH HER!"]],[["rhh"],["CHAT WITH HER!"]],[["zhdouqfmlkenjzdijxdfxnlegxeuvhelo"],["IGNORE HIM!"]],[["yufkkfwyhhvcjntsgsvpzbhqtmtgyxifqoewmuplphykmptfdebjxuaxigomjtwgtljwdjhjernkitifbomifbhysnmadtnyn"],["CHAT WITH HER!"]],[["urigreuzpxnej"],["CHAT WITH HER!"]]]}} +{"instance_id":"pseudo_to_code_0.5k_159","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n a, b, c, d =integers\n Read a, b, c, d\n set a = maximum value of 3 * a \/ 10 and a - a * c \/ 250\n set b = maximum value of 3 * b \/ 10 and b - b * d \/ 250\n if a is greater than b\n print Misha and a new line\n else if b is greater than a\n print Vasya and a new line\n else do the following\n print Tie and a new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int a, b, c, d;\n cin >> a >> b >> c >> d;\n a = max(3 * a \/ 10, a - a * c \/ 250);\n b = max(3 * b \/ 10, b - b * d \/ 250);\n if (a > b)\n cout << \"Misha\" << endl;\n else if (b > a)\n cout << \"Vasya\" << endl;\n else\n cout << \"Tie\" << endl;\n return 0;\n}","item":{"problem_id":"501A","pseudocode":"define the main function\n a, b, c, d =integers\n Read a, b, c, d\n set a = maximum value of 3 * a \/ 10 and a - a * c \/ 250\n set b = maximum value of 3 * b \/ 10 and b - b * d \/ 250\n if a is greater than b\n print Misha and a new line\n else if b is greater than a\n print Vasya and a new line\n else do the following\n print Tie and a new line\n return to indicate successful execution\nend of the block","testcases":[[["500 1000 20 30"],["Vasya"]],[["1000 1000 1 1"],["Tie"]],[["1500 1000 176 177"],["Misha"]],[["1500 1000 74 177"],["Misha"]],[["750 2500 175 178"],["Vasya"]],[["750 1000 54 103"],["Tie"]],[["2000 1250 176 130"],["Tie"]],[["1250 1750 145 179"],["Tie"]],[["2000 2000 176 179"],["Tie"]],[["1500 1500 148 148"],["Tie"]],[["2750 1750 134 147"],["Misha"]],[["3250 250 175 173"],["Misha"]],[["500 500 170 176"],["Misha"]],[["250 1000 179 178"],["Vasya"]],[["3250 1000 160 138"],["Misha"]],[["3000 2000 162 118"],["Tie"]],[["1500 1250 180 160"],["Tie"]],[["1250 2500 100 176"],["Tie"]],[["3500 3500 177 178"],["Tie"]],[["3000 3250 16 34"],["Tie"]],[["1750 3000 137 49"],["Vasya"]],[["500 1500 179 71"],["Vasya"]],[["1250 2000 101 180"],["Misha"]],[["250 750 180 176"],["Vasya"]],[["2250 2250 163 145"],["Vasya"]],[["3000 3000 176 78"],["Vasya"]],[["250 3500 8 178"],["Vasya"]],[["1750 1250 179 180"],["Misha"]],[["2750 1750 13 164"],["Misha"]],[["1750 2250 178 53"],["Vasya"]],[["2500 2750 73 179"],["Misha"]],[["1000 3500 178 175"],["Vasya"]],[["1000 500 7 162"],["Misha"]],[["1000 250 175 48"],["Misha"]],[["1750 500 166 177"],["Misha"]],[["250 250 0 0"],["Tie"]],[["250 3500 0 0"],["Vasya"]],[["250 3500 0 180"],["Vasya"]],[["3500 3500 180 180"],["Tie"]],[["3500 250 0 180"],["Misha"]]]}} +{"instance_id":"pseudo_to_code_0.5k_160","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n =integer\n Read n\n ch = character\n counter_A = integer with 0\n counter_D = integer with 0\n while n is greater than 0\n Read ch\n if ch is equal to A\n increment counter_A\n else do the following\n increment counter_D\n decrement n\n end of the block\n if counter_A is greater than counter_D\n print Anton and a new line\n lse if counter_D is greater than counter_A\n print Danik and a new line\n else do the following\n print Friendship and a new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n char ch;\n int counter_A = 0;\n int counter_D = 0;\n while (n > 0) {\n cin >> ch;\n if (ch == 'A')\n counter_A++;\n else\n counter_D++;\n n--;\n }\n if (counter_A > counter_D)\n cout << \"Anton\\n\";\n else if (counter_D > counter_A)\n cout << \"Danik\\n\";\n else\n cout << \"Friendship\\n\";\n return 0;\n}","item":{"problem_id":"734A","pseudocode":"define the main function\n n =integer\n Read n\n ch = character\n counter_A = integer with 0\n counter_D = integer with 0\n while n is greater than 0\n Read ch\n if ch is equal to A\n increment counter_A\n else do the following\n increment counter_D\n decrement n\n end of the block\n if counter_A is greater than counter_D\n print Anton and a new line\n lse if counter_D is greater than counter_A\n print Danik and a new line\n else do the following\n print Friendship and a new line\n return to indicate successful execution\nend of the block","testcases":[[["6","ADAAAA"],["Anton"]],[["7","DDDAADA"],["Danik"]],[["6","DADADA"],["Friendship"]],[["10","DDDDADDADD"],["Danik"]],[["40","AAAAAAAAADDAAAAAAAAAAADADDAAAAAAAAAAADAA"],["Anton"]],[["200","DDDDDDDADDDDDDAADADAADAAADAADADAAADDDADDDDDDADDDAADDDAADADDDDDADDDAAAADAAADDDDDAAADAADDDAAAADDADADDDAADDAADAAADAADAAAADDAADDADAAAADADDDAAAAAADDAADAADAADADDDAAADAAAADADDADAAAAAADADADDDADDDAADDADDDAAAAD"],["Friendship"]],[["1","A"],["Anton"]],[["1","D"],["Danik"]],[["2","DA"],["Friendship"]],[["4","DADA"],["Friendship"]],[["4","DAAD"],["Friendship"]],[["3","ADD"],["Danik"]],[["3","DAD"],["Danik"]],[["2","DA"],["Friendship"]],[["379","AADAAAAAADDAAAAAADAADADADDAAAAADADDAADAAAADDDADAAAAAAADAADAAAAAAADAAAAAAAAADAAAAAAADAAAAAAAAAAADDDADAAAAAAAADAADADAAAADAAAAAAAAAAAAAAAAADAAAADDDAADAAAAAAADAAADAAADAADDDADDAAADAAAAAADDDADDDAAADAAAADAAAAAAAAADAAADAAAAAAAAADAAAAAAAAAAAAAAAAAADADAAAAAAAAAAADAAAAADAAAADAAAAAAAAAAAAADADAADAAAAAAAADAADAAAAAAAADAAAAAAAADDDAAAAAADAAADAAAAAADAADAAAAAADAAAADADAADAAAAAADAAAADAADDAADAADAAA"],["Anton"]]]}} +{"instance_id":"pseudo_to_code_0.5k_161","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate integers n, m, startx, starty, finishx, finishy, with startx=55, starty=55\ncreate 2d character array st with size 55 by 55\ndefine the main function\n read n read m\n for i = 1 to n inclusive\n for j = 1 to m inclusive\n read st[i][j]\n if st[i][j] is '*'\n set startx to minimum of startx and i\n set starty to minimum of starty and j\n set finishx to maximum of finishx and i\n set finishy to maximum of finishy and j\n end of the block\n end of the block\n for i = startx to finishx inclusive\n for j = starty to finishy inclusive, print st[i][j]\n print newline\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int n, m, startx = 55, starty = 55, finishx, finishy;\nchar st[55][55];\nint main() {\n cin >> n >> m;\n for (int i = 1; i <= n; i++)\n for (int j = 1; j <= m; j++) {\n cin >> st[i][j];\n if (st[i][j] == '*') {\n startx = min(startx, i);\n starty = min(starty, j);\n finishx = max(finishx, i);\n finishy = max(finishy, j);\n }\n }\n for (int i = startx; i <= finishx; i++) {\n for (int j = starty; j <= finishy; j++) { cout << st[i][j]; }\n cout << endl;\n }\n return 0;\n}","item":{"problem_id":"14A","pseudocode":"create integers n, m, startx, starty, finishx, finishy, with startx=55, starty=55\ncreate 2d character array st with size 55 by 55\ndefine the main function\n read n read m\n for i = 1 to n inclusive\n for j = 1 to m inclusive\n read st[i][j]\n if st[i][j] is '*'\n set startx to minimum of startx and i\n set starty to minimum of starty and j\n set finishx to maximum of finishx and i\n set finishy to maximum of finishy and j\n end of the block\n end of the block\n for i = startx to finishx inclusive\n for j = starty to finishy inclusive, print st[i][j]\n print newline\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["6 7",".......","..***..","..*....","..***..","..*....","..***.."],["***","*..","***","*..","***"]],[["3 3","***","*.*","***"],["***","*.*","***"]],[["1 1","*"],["*"]],[["2 1","*","*"],["*","*"]],[["5 1",".","*",".",".","."],["*"]],[["1 6","*****."],["*****"]],[["2 2","..","*."],["*"]],[["8 2","..","..","..","..","..","*.","..",".."],["*"]],[["50 1",".",".",".",".",".",".",".",".",".",".",".",".",".",".",".","*",".","*",".",".",".",".",".",".",".",".",".",".",".",".",".",".",".",".",".","*",".",".",".",".",".",".",".",".",".",".",".",".",".","."],["*",".","*",".",".",".",".",".",".",".",".",".",".",".",".",".",".",".",".",".","*"]],[["2 1","*","."],["*"]],[["5 1","*","*","*","*","*"],["*","*","*","*","*"]],[["2 2","*.",".."],["*"]],[["3 4","...*","*...","..*."],["...*","*...","..*."]],[["8 2","**","**","**","**","**","**","**","**"],["**","**","**","**","**","**","**","**"]],[["50 1",".","*","*","*",".",".","*",".","*","*","*","*","*","*","*",".","*","*","*","*","*","*","*","*","*","*","*","*","*",".",".",".",".","*","*",".","*","*",".",".",".",".","*","*",".",".",".",".",".","."],["*","*","*",".",".","*",".","*","*","*","*","*","*","*",".","*","*","*","*","*","*","*","*","*","*","*","*","*",".",".",".",".","*","*",".","*","*",".",".",".",".","*","*"]]]}} +{"instance_id":"pseudo_to_code_0.5k_162","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ncreate int n, a[1001]\ndefine the main function\n read n\n for i=1 to n inclusive, read a[i]\n ans=0\n for i=2 to n exclusive\n if a[i] > a[i + 1] and a[i] > a[i - 1]\n increment ans\n continue\n end of the block\n if a[i] < a[i + 1] and a[i] < a[i - 1], increment ans\n end of the block\n print ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int n, a[1001];\nint main() {\n cin >> n;\n for (int i = 1; i <= n; i++) { cin >> a[i]; }\n int ans = 0;\n for (int i = 2; i < n; i++) {\n if (a[i] > a[i + 1] && a[i] > a[i - 1]) {\n ans++;\n continue;\n }\n if (a[i] < a[i + 1] && a[i] < a[i - 1]) { ans++; }\n }\n cout << ans << endl;\n return 0;\n}","item":{"problem_id":"888A","pseudocode":"create int n, a[1001]\ndefine the main function\n read n\n for i=1 to n inclusive, read a[i]\n ans=0\n for i=2 to n exclusive\n if a[i] > a[i + 1] and a[i] > a[i - 1]\n increment ans\n continue\n end of the block\n if a[i] < a[i + 1] and a[i] < a[i - 1], increment ans\n end of the block\n print ans\n return to indicate successful execution\nend of the block","testcases":[[["3","1 2 3"],["0"]],[["4","1 5 2 5"],["2"]],[["1","1"],["0"]],[["1","548"],["0"]],[["2","1 1"],["0"]],[["3","3 2 3"],["1"]],[["2","1 1000"],["0"]],[["3","1 2 1"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_163","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create long long n and a\n read n\n if n is even\n a= n\/2\n else\n set ((n + 1) \/ 2) * (-1)\n print a\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long n, a;\n cin >> n;\n if (n % 2 == 0)\n a = n \/ 2;\n else\n a = ((n + 1) \/ 2) * (-1);\n cout << a << endl;\n return 0;\n}","item":{"problem_id":"486A","pseudocode":"define the main function\n create long long n and a\n read n\n if n is even\n a= n\/2\n else\n set ((n + 1) \/ 2) * (-1)\n print a\n return to indicate successful execution\nend of the block","testcases":[[["4"],["2"]],[["5"],["-3"]],[["1000000000"],["500000000"]],[["1000000001"],["-500000001"]],[["1000000000000000"],["500000000000000"]],[["100"],["50"]],[["101"],["-51"]],[["102"],["51"]],[["103"],["-52"]],[["104"],["52"]],[["105"],["-53"]],[["106"],["53"]],[["107"],["-54"]],[["108"],["54"]],[["109"],["-55"]],[["208170109961052"],["104085054980526"]],[["46017661651072"],["23008830825536"]],[["4018154546667"],["-2009077273334"]],[["288565475053"],["-144282737527"]],[["3052460231"],["-1526230116"]],[["29906716"],["14953358"]],[["87897701693326"],["43948850846663"]],[["8240"],["4120"]],[["577935"],["-288968"]],[["62"],["31"]],[["1"],["-1"]],[["2"],["1"]],[["9999999999999"],["-5000000000000"]],[["1000000000000"],["500000000000"]],[["99999999999999"],["-50000000000000"]],[["999999999999999"],["-500000000000000"]],[["42191359342"],["21095679671"]],[["100000000000000"],["50000000000000"]],[["145645214654154"],["72822607327077"]],[["4294967296"],["2147483648"]],[["3037000499"],["-1518500250"]],[["10000000000001"],["-5000000000001"]],[["100000017040846"],["50000008520423"]],[["98979894985999"],["-49489947493000"]]]}} +{"instance_id":"pseudo_to_code_0.5k_164","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n sum and cost are integers= 0\n let n be integer\n read n\n integer array out with size [n + 1] filled with 0\n integer array in with size [n + 1] filled with 0\n for integer i = 0 to n exclusive\n create integers a, b and c\n read a, b and c\n if out[a] or in[b]\n increase sum by c\n set out[b] to 1\n in[a] = 1\n else\n set value of out[a] to 1\n set value of in[b] to 1\n end of the block\n increase cost by c\n end of the block\n print min of cost - sum and sum and a new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int sum = 0, cost = 0;\n int n;\n cin >> n;\n int out[n + 1] = {0};\n int in[n + 1] = {0};\n for (int i = 0; i < n; i++) {\n int a, b, c;\n cin >> a >> b >> c;\n if (out[a] || in[b]) {\n sum += c;\n out[b] = 1;\n in[a] = 1;\n } else {\n out[a] = 1;\n in[b] = 1;\n }\n cost += c;\n }\n cout << min(cost - sum, sum) << endl;\n return 0;\n}","item":{"problem_id":"24A","pseudocode":"define the main function\n sum and cost are integers= 0\n let n be integer\n read n\n integer array out with size [n + 1] filled with 0\n integer array in with size [n + 1] filled with 0\n for integer i = 0 to n exclusive\n create integers a, b and c\n read a, b and c\n if out[a] or in[b]\n increase sum by c\n set out[b] to 1\n in[a] = 1\n else\n set value of out[a] to 1\n set value of in[b] to 1\n end of the block\n increase cost by c\n end of the block\n print min of cost - sum and sum and a new line\n return to indicate successful execution\nend of the block","testcases":[[["3","1 3 1","1 2 1","3 2 1"],["1"]],[["3","1 3 1","1 2 5","3 2 1"],["2"]],[["6","1 5 4","5 3 8","2 4 15","1 6 16","2 3 23","4 6 42"],["39"]],[["4","1 2 9","2 3 8","3 4 7","4 1 5"],["0"]],[["5","5 3 89","2 3 43","4 2 50","1 4 69","1 5 54"],["143"]],[["10","1 8 16","6 1 80","6 5 27","5 7 86","7 9 72","4 9 20","4 3 54","3 2 57","10 2 61","8 10 90"],["267"]],[["17","8 12 43","13 12 70","7 13 68","11 7 19","5 11 24","5 1 100","4 1 10","3 4 68","2 3 46","15 2 58","15 6 38","6 9 91","9 10 72","14 10 32","14 17 97","17 16 67","8 16 40"],["435"]],[["22","18 22 46","18 21 87","5 21 17","5 10 82","10 12 81","17 12 98","16 17 17","16 13 93","4 13 64","4 11 65","15 11 18","6 15 35","6 7 61","7 19 12","19 1 65","8 1 32","8 2 46","9 2 19","9 3 58","3 14 65","20 14 67","20 22 2"],["413"]],[["39","18 11 10","5 18 97","5 39 77","39 24 64","24 28 79","28 14 6","34 14 72","6 34 64","6 12 93","12 8 66","13 8 40","35 13 20","35 32 4","32 19 55","19 3 18","3 21 26","30 21 54","30 27 5","4 27 8","22 4 89","15 22 54","15 2 90","36 2 58","33 36 4","33 17 50","17 16 21","31 16 64","1 31 77","1 23 89","23 7 62","38 7 74","9 38 15","9 25 93","25 10 32","10 26 78","20 26 63","37 20 9","29 37 33","11 29 45"],["950"]],[["50","30 34 48","11 30 15","11 5 98","4 5 57","43 4 21","14 43 74","14 19 52","45 19 60","45 28 52","24 28 94","24 26 2","48 26 48","48 13 53","13 42 7","42 37 23","37 17 70","17 7 29","20 7 93","33 20 21","33 2 53","21 2 83","49 21 33","46 49 28","18 46 1","36 18 99","47 36 52","47 29 41","41 29 40","31 41 45","31 38 25","38 25 41","25 8 18","9 8 60","9 27 29","16 27 17","16 22 6","22 39 1","1 39 8","1 50 89","50 12 64","40 12 7","40 44 71","44 10 23","15 10 70","15 32 53","23 32 92","35 23 14","35 3 25","3 6 93","6 34 99"],["1117"]],[["3","3 1 1","2 1 1","2 3 1"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_165","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integers n, k\n create string s\n read n read k\n read s\n create integer vector t initialized with k\n for i = 0 to n exclusive, increment t[s[i] - 'A']\n create integer min with min = n + 1\n create boolean b with b = 0\n for i = 0 to k exclusive\n if t[i] is 0, set b to 1\n if t[i] is less than min, set min to t[i]\n end of the block\n if b is true\n print \"0\" print newline\n else\n print min * k print newline\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, k;\n string s;\n cin >> n >> k;\n cin >> s;\n vector t(k);\n for (int i = 0; i < n; i++) { t[s[i] - 'A']++; }\n int min = n + 1;\n bool b = 0;\n for (int i = 0; i < k; i++) {\n if (t[i] == 0) b = 1;\n if (t[i] < min) min = t[i];\n }\n if (b)\n cout << \"0\" << endl;\n else\n cout << min * k << endl;\n}","item":{"problem_id":"1038A","pseudocode":"define the main function\n create integers n, k\n create string s\n read n read k\n read s\n create integer vector t initialized with k\n for i = 0 to n exclusive, increment t[s[i] - 'A']\n create integer min with min = n + 1\n create boolean b with b = 0\n for i = 0 to k exclusive\n if t[i] is 0, set b to 1\n if t[i] is less than min, set min to t[i]\n end of the block\n if b is true\n print \"0\" print newline\n else\n print min * k print newline\nend of the block","testcases":[[["9 3","ACAABCCAB"],["6"]],[["9 4","ABCABCABC"],["0"]],[["1 26","A"],["0"]],[["22 1","AAAAAAAAAAAAAAAAAAAAAA"],["22"]],[["15 26","WEYYDIADTLCOUEG"],["0"]],[["2 2","BA"],["2"]],[["6 3","AABBCC"],["6"]],[["1 5","A"],["0"]],[["10 2","ABBBBBBBBB"],["2"]],[["1 1","A"],["1"]],[["6 3","ABBCCC"],["3"]],[["7 2","AABBBBB"],["4"]],[["76 26","ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYABCDEFGHIJKLMNOPQRSTUVWXY"],["26"]],[["5 3","AABBC"],["3"]],[["3 3","AAC"],["0"]],[["1 4","D"],["0"]],[["3 2","BBB"],["0"]],[["3 3","CBA"],["3"]],[["3 5","ABC"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_166","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nk = long long and a, b = long long array of size 3 each\ndefine the main function\n read a[0] then a[1] then a[2] then k\n set k to min of k and a[0] + a[1] + a[2] - 3\n sort a\n set all values of b to k \/ 3\n for i = 0 to k % 3 increment b[2 - i]\n for i = 0 to 2\n if b[i] is greater or equal to a[i]\n increment b[2] by b[i] - (a[i] - 1)\n set b[i] to a[i] - 1\n end of the block\n end of the block\n loop while b[2] - 1 is greater or equal to b[1] + 1 and b[1] + 1 is less than a[1] incrementing b[1] and decrementing b[2]\n print (b[0] + 1) * (b[1] + 1) * (b[2] + 1)\nend of the block\n\n[CODE]:","reference_output":"long long a[3], b[3], k;\nint main() {\n cin >> a[0] >> a[1] >> a[2] >> k;\n k = min(k, a[0] + a[1] + a[2] - 3);\n sort(a, a + 3);\n for (long long i = 0; i < 3; i++) b[i] = k \/ 3;\n for (long long i = 0; i < k % 3; i++) b[2 - i]++;\n for (long long i = 0; i < 2; i++) {\n if (b[i] >= a[i]) {\n b[2] += b[i] - (a[i] - 1);\n b[i] = a[i] - 1;\n }\n }\n while (b[2] - 1 >= b[1] + 1 && b[1] + 1 < a[1]) b[1]++, b[2]--;\n cout << (b[0] + 1) * (b[1] + 1) * (b[2] + 1) << '\\n';\n}","item":{"problem_id":"73A","pseudocode":"k = long long and a, b = long long array of size 3 each\ndefine the main function\n read a[0] then a[1] then a[2] then k\n set k to min of k and a[0] + a[1] + a[2] - 3\n sort a\n set all values of b to k \/ 3\n for i = 0 to k % 3 increment b[2 - i]\n for i = 0 to 2\n if b[i] is greater or equal to a[i]\n increment b[2] by b[i] - (a[i] - 1)\n set b[i] to a[i] - 1\n end of the block\n end of the block\n loop while b[2] - 1 is greater or equal to b[1] + 1 and b[1] + 1 is less than a[1] incrementing b[1] and decrementing b[2]\n print (b[0] + 1) * (b[1] + 1) * (b[2] + 1)\nend of the block","testcases":[[["2 2 2 3"],["8"]],[["2 2 2 1"],["2"]],[["1 1 1 1"],["1"]],[["1 2 3 3"],["6"]],[["20 4 5 12"],["120"]],[["100 500 100500 1000000000"],["5025000000"]],[["2 5 5 9"],["50"]],[["11 1 11 11"],["42"]],[["100500 5000 500 100000000"],["251250000000"]],[["2 2 2 0"],["1"]],[["1000000 1000000 1000000 2444441"],["540974149875309150"]],[["1000000 1000000 1000000 1000000000"],["1000000000000000000"]],[["1000000 1000000 1000000 2999996"],["999999000000000000"]],[["1000000 1000000 1000000 2999997"],["1000000000000000000"]],[["999999 1000000 999997 999999999"],["999996000003000000"]],[["500000 1000000 750000 100000"],["37040370459260"]],[["999999 1 999998 1333333"],["444445555556"]],[["500000 10000 1000000 29998"],["1000100000000"]],[["10000 500000 1000000 29999"],["1000200010000"]],[["10000 1000000 500000 29996"],["999900000000"]],[["999999 123456 987654 0"],["1"]],[["1 1 1 0"],["1"]],[["219482 801483 941695 280976"],["821595067700400"]],[["808994 288453 204353 580644"],["7250580779648149"]],[["428676 64403 677407 626161"],["5081000961597840"]],[["559002 326875 150818 157621"],["145045169133102"]],[["178008 590076 624581 201286"],["302062187173952"]],[["797745 854005 98703 735186"],["9996502351557447"]],[["418223 118667 573175 776998"],["12857677898465963"]],[["39436 384053 48008 313346"],["427693170156640"]],[["661377 149342 523189 353305"],["1633415415004970"]],[["781081 414037 495753 892089"],["26294515330164544"]],[["402353 679460 969495 930195"],["29810031851367496"]],[["593408 709898 624186 915570"],["28425961712082871"]],[["1000 988 1000000 3000"],["1002820000"]],[["91839 2 3 50"],["288"]],[["999900 999990 4 129"],["16384"]],[["1024 100000 4 13"],["144"]],[["1000000 1000000 1000000 1000000000"],["1000000000000000000"]],[["1 1000000 1 1000000000"],["1000000"]],[["2 1000 1000000 1000000000"],["2000000000"]],[["999999 2 1000000 1000000000"],["1999998000000"]],[["1000 1 1 1"],["2"]],[["1000 1 1 998"],["999"]],[["1000 1 1 1000"],["1000"]],[["33334 66667 1000000 100000"],["37040370459260"]],[["1 1000000 2 23123"],["46246"]]]}} +{"instance_id":"pseudo_to_code_0.5k_167","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare integer array arr size 10000\ndeclare integer veector v\ndeclare integer array brr size 10000\ndefine the main function\n declare integer n\n read n\n for i = 1 to n inclusive\n declare integer m\n read m\n let arr[i] be m\n add m to end of v\n end of the block\n sort from beginning of v to end of v\n declare integers idx = 1, cur\n for i = n - 1 to 0 inclusive, decrementing i\n if i is n - 1\n let cur be v[i]\n let brr[idx] be v[i]\n else\n if cur is not v[i]\n let brr[idx] be v[i]\n let cur be v[i]\n end of the block\n end of the block\n increment idx\n end of the block\n for i = 1 to n inclusive\n for j = 1 to n inclusive\n if arr[i] is brr[j] and arr[i] is not 0 and brr[j] is not 0\n if i is n\n print j and newline\n else\n print j and \" \"\n end of the block\n end of the block\n end of the block\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int arr[10000];\nvector v;\nint brr[10000];\nint main() {\n int n;\n cin >> n;\n for (int i = 1; i <= n; i++) {\n int m;\n cin >> m;\n arr[i] = m;\n v.push_back(m);\n }\n sort(v.begin(), v.end());\n int idx = 1, cur;\n for (int i = n - 1; i >= 0; i--) {\n if (i == n - 1) {\n cur = v[i];\n brr[idx] = v[i];\n } else {\n if (cur != v[i]) {\n brr[idx] = v[i];\n cur = v[i];\n }\n }\n idx++;\n }\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n if (arr[i] == brr[j] && arr[i] != 0 && brr[j] != 0) {\n if (i == n) {\n cout << j << endl;\n } else {\n cout << j << \" \";\n }\n }\n }\n }\n}","item":{"problem_id":"551A","pseudocode":"declare integer array arr size 10000\ndeclare integer veector v\ndeclare integer array brr size 10000\ndefine the main function\n declare integer n\n read n\n for i = 1 to n inclusive\n declare integer m\n read m\n let arr[i] be m\n add m to end of v\n end of the block\n sort from beginning of v to end of v\n declare integers idx = 1, cur\n for i = n - 1 to 0 inclusive, decrementing i\n if i is n - 1\n let cur be v[i]\n let brr[idx] be v[i]\n else\n if cur is not v[i]\n let brr[idx] be v[i]\n let cur be v[i]\n end of the block\n end of the block\n increment idx\n end of the block\n for i = 1 to n inclusive\n for j = 1 to n inclusive\n if arr[i] is brr[j] and arr[i] is not 0 and brr[j] is not 0\n if i is n\n print j and newline\n else\n print j and \" \"\n end of the block\n end of the block\n end of the block\n end of the block\nend of the block","testcases":[[["3","1 3 3"],["3 1 1"]],[["1","1"],["1"]],[["5","3 5 3 4 5"],["4 1 4 3 1"]],[["7","1 3 5 4 2 2 1"],["6 3 1 2 4 4 6"]],[["11","5 6 4 2 9 7 6 6 6 6 7"],["9 4 10 11 1 2 4 4 4 4 2"]],[["1","2000"],["1"]],[["2","2000 2000"],["1 1"]],[["3","500 501 502"],["3 2 1"]],[["10","105 106 1 1 1 11 1000 999 1000 999"],["6 5 8 8 8 7 1 3 1 3"]],[["6","1 2 3 4 5 6"],["6 5 4 3 2 1"]],[["7","6 5 4 3 2 1 1"],["1 2 3 4 5 6 6"]],[["8","153 100 87 14 10 8 6 5"],["1 2 3 4 5 6 7 8"]],[["70","11 54 37 62 1 46 13 17 38 47 28 15 63 5 61 34 49 66 32 59 3 41 58 28 23 62 41 64 20 5 14 41 10 37 51 32 65 46 61 8 15 19 16 44 31 42 19 46 66 25 26 58 60 5 19 18 69 53 20 40 45 27 24 41 32 23 57 56 62 10"],["62 18 35 7 70 23 61 56 34 22 42 58 6 66 10 37 21 2 38 13 69 29 14 42 48 7 29 5 50 66 60 29 63 35 20 38 4 23 10 65 58 52 57 27 41 28 52 23 2 46 45 14 12 66 52 55 1 19 50 33 26 44 47 29 38 48 16 17 7 63"]],[["5","1 2000 1 1 2000"],["3 1 3 3 1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_168","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integers n, x, y, z, xsum(0), ysum(0), zsum(0)\n read n\n decrement n and loop while n > 0\n read x, y and z\n increase xsum by x\n increase ysum by y\n increase zsum by z\n end of the block\n if xsum = 0 && ysum = 0 && zsum = 0\n print \"YES\"\n else\n print \"NO\"\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, x, y, z, xsum(0), ysum(0), zsum(0);\n cin >> n;\n while (n--) {\n cin >> x >> y >> z;\n xsum += x;\n ysum += y;\n zsum += z;\n }\n if (xsum == 0 && ysum == 0 && zsum == 0) {\n cout << \"YES\" << endl;\n } else {\n cout << \"NO\" << endl;\n }\n return 0;\n}","item":{"problem_id":"69A","pseudocode":"define the main function\n create integers n, x, y, z, xsum(0), ysum(0), zsum(0)\n read n\n decrement n and loop while n > 0\n read x, y and z\n increase xsum by x\n increase ysum by y\n increase zsum by z\n end of the block\n if xsum = 0 && ysum = 0 && zsum = 0\n print \"YES\"\n else\n print \"NO\"\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["3","4 1 7","-2 4 -1","1 -5 -3"],["NO"]],[["3","3 -1 7","-5 2 -4","2 -1 -3"],["YES"]],[["10","21 32 -46","43 -35 21","42 2 -50","22 40 20","-27 -9 38","-4 1 1","-40 6 -31","-13 -2 34","-21 34 -12","-32 -29 41"],["NO"]],[["10","25 -33 43","-27 -42 28","-35 -20 19","41 -42 -1","49 -39 -4","-49 -22 7","-19 29 41","8 -27 -43","8 34 9","-11 -3 33"],["NO"]],[["10","-6 21 18","20 -11 -8","37 -11 41","-5 8 33","29 23 32","30 -33 -11","39 -49 -36","28 34 -49","22 29 -34","-18 -6 7"],["NO"]],[["10","47 -2 -27","0 26 -14","5 -12 33","2 18 3","45 -30 -49","4 -18 8","-46 -44 -41","-22 -10 -40","-35 -21 26","33 20 38"],["NO"]],[["13","-3 -36 -46","-11 -50 37","42 -11 -15","9 42 44","-29 -12 24","3 9 -40","-35 13 50","14 43 18","-13 8 24","-48 -15 10","50 9 -50","21 0 -50","0 0 -6"],["YES"]],[["14","43 23 17","4 17 44","5 -5 -16","-43 -7 -6","47 -48 12","50 47 -45","2 14 43","37 -30 15","4 -17 -11","17 9 -45","-50 -3 -8","-50 0 0","-50 0 0","-16 0 0"],["YES"]],[["13","29 49 -11","38 -11 -20","25 1 -40","-11 28 11","23 -19 1","45 -41 -17","-3 0 -19","-13 -33 49","-30 0 28","34 17 45","-50 9 -27","-50 0 0","-37 0 0"],["YES"]],[["12","3 28 -35","-32 -44 -17","9 -25 -6","-42 -22 20","-19 15 38","-21 38 48","-1 -37 -28","-10 -13 -50","-5 21 29","34 28 50","50 11 -49","34 0 0"],["YES"]],[["37","-64 -79 26","-22 59 93","-5 39 -12","77 -9 76","55 -86 57","83 100 -97","-70 94 84","-14 46 -94","26 72 35","14 78 -62","17 82 92","-57 11 91","23 15 92","-80 -1 1","12 39 18","-23 -99 -75","-34 50 19","-39 84 -7","45 -30 -39","-60 49 37","45 -16 -72","33 -51 -56","-48 28 5","97 91 88","45 -82 -11","-21 -15 -90","-53 73 -26","-74 85 -90","-40 23 38","100 -13 49","32 -100 -100","0 -100 -70","0 -100 0","0 -100 0","0 -100 0","0 -100 0","0 -37 0"],["YES"]],[["4","68 3 100","68 21 -100","-100 -24 0","-36 0 0"],["YES"]],[["33","-1 -46 -12","45 -16 -21","-11 45 -21","-60 -42 -93","-22 -45 93","37 96 85","-76 26 83","-4 9 55","7 -52 -9","66 8 -85","-100 -54 11","-29 59 74","-24 12 2","-56 81 85","-92 69 -52","-26 -97 91","54 59 -51","58 21 -57","7 68 56","-47 -20 -51","-59 77 -13","-85 27 91","79 60 -56","66 -80 5","21 -99 42","-31 -29 98","66 93 76","-49 45 61","100 -100 -100","100 -100 -100","66 -75 -100","0 0 -100","0 0 -87"],["YES"]],[["3","1 2 3","3 2 1","0 0 0"],["NO"]],[["2","5 -23 12","0 0 0"],["NO"]],[["1","0 0 0"],["YES"]],[["1","1 -2 0"],["NO"]],[["2","-23 77 -86","23 -77 86"],["YES"]],[["26","86 7 20","-57 -64 39","-45 6 -93","-44 -21 100","-11 -49 21","73 -71 -80","-2 -89 56","-65 -2 7","5 14 84","57 41 13","-12 69 54","40 -25 27","-17 -59 0","64 -91 -30","-53 9 42","-54 -8 14","-35 82 27","-48 -59 -80","88 70 79","94 57 97","44 63 25","84 -90 -40","-100 100 -100","-92 100 -100","0 10 -100","0 0 -82"],["YES"]],[["42","11 27 92","-18 -56 -57","1 71 81","33 -92 30","82 83 49","-87 -61 -1","-49 45 49","73 26 15","-22 22 -77","29 -93 87","-68 44 -90","-4 -84 20","85 67 -6","-39 26 77","-28 -64 20","65 -97 24","-72 -39 51","35 -75 -91","39 -44 -8","-25 -27 -57","91 8 -46","-98 -94 56","94 -60 59","-9 -95 18","-53 -37 98","-8 -94 -84","-52 55 60","15 -14 37","65 -43 -25","94 12 66","-8 -19 -83","29 81 -78","-58 57 33","24 86 -84","-53 32 -88","-14 7 3","89 97 -53","-5 -28 -91","-100 100 -6","-84 100 0","0 100 0","0 70 0"],["YES"]],[["3","96 49 -12","2 -66 28","-98 17 -16"],["YES"]],[["5","70 -46 86","-100 94 24","-27 63 -63","57 -100 -47","0 -11 0"],["YES"]],[["18","-86 -28 70","-31 -89 42","31 -48 -55","95 -17 -43","24 -95 -85","-21 -14 31","68 -18 81","13 31 60","-15 28 99","-42 15 9","28 -61 -62","-16 71 29","-28 75 -48","-77 -67 36","-100 83 89","100 100 -100","57 34 -100","0 0 -53"],["YES"]],[["44","52 -54 -29","-82 -5 -94","-54 43 43","91 16 71","7 80 -91","3 15 29","-99 -6 -77","-3 -77 -64","73 67 34","25 -10 -18","-29 91 63","-72 86 -16","-68 85 -81","-3 36 44","-74 -14 -80","34 -96 -97","-76 -78 -33","-24 44 -58","98 12 77","95 -63 -6","-51 3 -90","-92 -10 72","7 3 -68","57 -53 71","29 57 -48","35 -60 10","79 -70 -61","-20 77 55","-86 -15 -35","84 -88 -18","100 -42 77","-20 46 8","-41 -43 -65","38 -98 -23","-100 65 45","-7 -91 -63","46 88 -85","48 59 100","0 0 100","0 0 100","0 0 100","0 0 100","0 0 100","0 0 1"],["YES"]],[["18","-14 -64 -91","-8 -66 -86","-23 92 -40","6 -3 -53","57 41 78","-79 42 -22","-88 -17 45","4 -45 44","83 -18 -25","34 86 -92","75 -30 12","44 99 11","-67 -13 72","22 83 -56","-37 71 72","-9 -100 100","0 -100 31","0 -58 0"],["YES"]],[["23","-70 37 78","42 84 6","28 -94 -24","-49 76 95","-67 18 84","-53 78 -5","65 -63 -64","-66 -64 -69","81 -93 95","10 52 -79","-89 -61 -64","-64 -47 43","-81 -35 55","80 82 73","-60 -81 -18","49 -10 -19","-58 70 12","-24 -15 -93","98 -93 -54","-28 -75 11","100 100 -63","100 100 0","56 34 0"],["YES"]],[["3","0 2 -2","1 -1 3","-3 0 0"],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_169","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n declare integers n, res = 0, cur, x, y\n read n\n declare integer vectors a initialized with n, b initialized with n\n for i = 0 to n exclusive, read a[i]\n for i = 0 to n exclusive, read b[i]\n for i = 0 to n exclusive\n let x be 0\n let y be 0\n for j = 0 to n exclusie\n let x be x bitwise or a[j]\n let y be y bitwise or b[j]\n let cur be x + y\n let res be maximum of ( res and cur )\n end of the block\n end of the block\n print res and newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, res = 0, cur, x, y;\n cin >> n;\n vector a(n), b(n);\n for (int i = 0; i < n; i++) { cin >> a[i]; }\n for (int i = 0; i < n; i++) { cin >> b[i]; }\n for (int i = 0; i < n; i++) {\n x = 0;\n y = 0;\n for (int j = i; j < n; j++) {\n x |= a[j];\n y |= b[j];\n cur = x + y;\n res = max(res, cur);\n }\n }\n cout << res << endl;\n return 0;\n}","item":{"problem_id":"631A","pseudocode":"define the main function\n declare integers n, res = 0, cur, x, y\n read n\n declare integer vectors a initialized with n, b initialized with n\n for i = 0 to n exclusive, read a[i]\n for i = 0 to n exclusive, read b[i]\n for i = 0 to n exclusive\n let x be 0\n let y be 0\n for j = 0 to n exclusie\n let x be x bitwise or a[j]\n let y be y bitwise or b[j]\n let cur be x + y\n let res be maximum of ( res and cur )\n end of the block\n end of the block\n print res and newline\n return to indicate successful execution\nend of the block","testcases":[[["5","1 2 4 3 2","2 3 3 12 1"],["22"]],[["10","13 2 7 11 8 4 9 8 5 1","5 7 18 9 2 3 0 11 8 6"],["46"]],[["25","12 30 38 109 81 124 80 33 38 48 29 78 96 48 96 27 80 77 102 65 80 113 31 118 35","25 64 95 13 12 6 111 80 85 16 61 119 23 65 73 65 20 95 124 18 28 79 125 106 116"],["254"]],[["20","64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64","64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64"],["128"]],[["1","1000000000","1000000000"],["2000000000"]],[["1","0","0"],["0"]],[["2","7 16","16 7"],["46"]],[["4","6 0 0 0","0 0 0 1"],["7"]],[["8","1 2 4 8 16 32 64 128","1 2 4 8 16 32 64 128"],["510"]],[["1","2","3"],["5"]],[["1","4","3"],["7"]],[["1","1","1"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_170","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nPI is a new constant double = acos of -1.0\nset constant integer inf to 1e9 casted to int\ndeclare new constant integer mod with value inf + 7\ndeclare long longs n, m, k, l, w, h, sum, mx and mn\ndefine the main function\n assign 1e9 to mn\n create new strings a and b\n read variables a and b from the input\n if a = b\n print a\n else\n print 1\n print new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const double PI = acos(-1.0);\nconst int inf = int(1e9);\nconst int mod = inf + 7;\nlong long n, m, k, l, w, h, sum, mx, mn;\nint main() {\n mn = (1e9);\n string a, b;\n cin >> a >> b;\n if (a == b)\n cout << a;\n else\n cout << 1;\n cout << endl;\n return 0;\n}","item":{"problem_id":"664A","pseudocode":"PI is a new constant double = acos of -1.0\nset constant integer inf to 1e9 casted to int\ndeclare new constant integer mod with value inf + 7\ndeclare long longs n, m, k, l, w, h, sum, mx and mn\ndefine the main function\n assign 1e9 to mn\n create new strings a and b\n read variables a and b from the input\n if a = b\n print a\n else\n print 1\n print new line\n return to indicate successful execution\nend of the block","testcases":[[["1 2"],["1"]],[["61803398874989484820458683436563811772030917980576 61803398874989484820458683436563811772030917980576"],["61803398874989484820458683436563811772030917980576"]],[["1 100"],["1"]],[["100 100000"],["1"]],[["12345 67890123456789123457"],["1"]],[["1 1"],["1"]],[["2 2"],["2"]],[["8392739158839273915883927391588392739158839273915883927391588392739158839273915883927391588392739158 8392739158839273915883927391588392739158839273915883927391588392739158839273915883927391588392739158"],["8392739158839273915883927391588392739158839273915883927391588392739158839273915883927391588392739158"]],[["1 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"],["1"]],[["8328748239473982794239847237438782379810988324751 9328748239473982794239847237438782379810988324751"],["1"]],[["1029398958432734901284327523909481928483573793 1029398958432734901284327523909481928483573794"],["1"]],[["10000 1000000000"],["1"]],[["10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"],["10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"]],[["11210171722243 65715435710585778347"],["1"]],[["2921881079263974825226940825843 767693191032295360887755303860323261471"],["1"]],[["8025352957265704896940312528736939363590612908210603 96027920417708260814607687034511406492969694925539085"],["1"]],[["23510978780782786207241069904470895053213996267165977112058175452757132930 210352653280909370107314249722987050753257161175393375412301228883856435481424"],["1"]],[["8150070767079366215626260746398623663859344142817267779361251788637547414925170226504788118262 49924902262298336032630839998470954964895251605110946547855439236151401194070172107435992986913614"],["1"]],[["15943150466658398903 15943150466658398903"],["15943150466658398903"]],[["410470228200245407491525399055972 410470228200245407491525399055972"],["410470228200245407491525399055972"]],[["51894705655711504622197349350106792045098781545973899451307 51894705655711504622197349350106792045098781545973899451307"],["51894705655711504622197349350106792045098781545973899451307"]],[["60353594589897438036015726222485085035927634677598681595162804007836722215668410 60353594589897438036015726222485085035927634677598681595162804007836722215668410"],["60353594589897438036015726222485085035927634677598681595162804007836722215668410"]],[["761733780145118977868180796896376577405349682060892737466239031663476251177476275459280340045369535 761733780145118977868180796896376577405349682060892737466239031663476251177476275459280340045369535"],["761733780145118977868180796896376577405349682060892737466239031663476251177476275459280340045369535"]],[["1 2000000000"],["1"]],[["13 1928834874"],["1"]],[["87 2938984237482934238"],["1"]],[["213 413"],["1"]],[["3 4"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_171","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create strings str1, str2, str3, str4\n read str1 read str2 read str3\n set str4 to str2\n create integers flag, flag1 with flag = 0, flag1 = 0\n if str1[0] is str3[2] and str1[1] is str3[1] and str1[2] is str3[0], set flag to 1\n if str2[0] is str2[2] and str2[1] is str2[1] and str2[2] is str2[0], set flag1 to 1\n if flag and flag1\n print \"YES\" print newline\n else\n print \"NO\" print newline\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string str1, str2, str3, str4;\n cin >> str1 >> str2 >> str3;\n str4 = str2;\n int flag = 0, flag1 = 0;\n if ((str1[0] == str3[2]) && (str1[1] == str3[1]) && (str1[2] == str3[0])) { flag = 1; }\n if ((str2[0] == str2[2]) && (str2[1] == str2[1]) && (str2[2] == str2[0])) { flag1 = 1; }\n if (flag && flag1) {\n cout << \"YES\" << endl;\n } else {\n cout << \"NO\" << endl;\n }\n return 0;\n}","item":{"problem_id":"12A","pseudocode":"define the main function\n create strings str1, str2, str3, str4\n read str1 read str2 read str3\n set str4 to str2\n create integers flag, flag1 with flag = 0, flag1 = 0\n if str1[0] is str3[2] and str1[1] is str3[1] and str1[2] is str3[0], set flag to 1\n if str2[0] is str2[2] and str2[1] is str2[1] and str2[2] is str2[0], set flag1 to 1\n if flag and flag1\n print \"YES\" print newline\n else\n print \"NO\" print newline\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["XX.","...",".XX"],["YES"]],[[".X.",".X.",".X."],["YES"]],[["XXX","XXX","XXX"],["YES"]],[["XXX","X.X","XXX"],["YES"]],[["X..",".X.","..X"],["YES"]],[["...","X.X","X.."],["NO"]],[[".X.","X.X",".X."],["YES"]],[["X.X",".X.","X.X"],["YES"]],[["...","...","..X"],["NO"]],[["XXX","...","XXX"],["YES"]],[["..X","X..","..X"],["NO"]],[[".X.","...","X.X"],["NO"]],[["X.X","X.X","X.X"],["YES"]],[[".X.","X.X","XX."],["NO"]],[["...","XXX","XXX"],["NO"]],[["XXX","..X","XXX"],["NO"]],[["X..","X.X",".X."],["NO"]],[["...","..X","XXX"],["NO"]],[["..X","X.X","X.."],["YES"]],[["..X","..X","XXX"],["NO"]],[["X..","X..","X.."],["NO"]],[["XXX",".X.","XXX"],["YES"]],[["..X","...","X.."],["YES"]],[["...","...","X.."],["NO"]],[["...","...",".X."],["NO"]],[["...","...","..X"],["NO"]],[["...",".X.","X.."],["NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_172","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let n, m, min1, max1, simmin , summax , o be integers with simmin = 0, summax = 0\n create a vector of integers by name of\n read n, m, min1, max1\n for integer y = 0 to m exclusive\n read o\n push_back o into of\n end of the block\n sort the values of.begin(), of.end()\n if min1 is not equal to of[0] , increment simmin by 1\n if min1 is greater than of[0]\n print Incorrect and newline\n return to indicate successful execution\n end of the block\n if max1 is less than of[m - 1]\n print Incorrect and newline\n return to indicate successful execution\n end of the block\n if max1 is not equal to of[m - 1] , increment summax by 1\n let sum be a integer with sum = simmin + summax\n if sum + m <= n\n print Correct and newline\n return to indicate successful execution\n else do the following\n print Incorrect and newline\n return to indicate successful execution\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, m, min1, max1, simmin = 0, summax = 0, o;\n vector of;\n cin >> n >> m >> min1 >> max1;\n for (int y = 0; y < m; y++) {\n cin >> o;\n of.push_back(o);\n }\n sort(of.begin(), of.end());\n if (min1 != of[0]) { simmin++; }\n if (min1 > of[0]) {\n cout << \"Incorrect\" << endl;\n return 0;\n }\n if (max1 < of[m - 1]) {\n cout << \"Incorrect\" << endl;\n return 0;\n }\n if (max1 != of[m - 1]) { summax++; }\n int sum = simmin + summax;\n if (sum + m <= n) {\n cout << \"Correct\" << endl;\n return 0;\n } else {\n cout << \"Incorrect\" << endl;\n return 0;\n }\n return 0;\n}","item":{"problem_id":"413A","pseudocode":"define the main function\n let n, m, min1, max1, simmin , summax , o be integers with simmin = 0, summax = 0\n create a vector of integers by name of\n read n, m, min1, max1\n for integer y = 0 to m exclusive\n read o\n push_back o into of\n end of the block\n sort the values of.begin(), of.end()\n if min1 is not equal to of[0] , increment simmin by 1\n if min1 is greater than of[0]\n print Incorrect and newline\n return to indicate successful execution\n end of the block\n if max1 is less than of[m - 1]\n print Incorrect and newline\n return to indicate successful execution\n end of the block\n if max1 is not equal to of[m - 1] , increment summax by 1\n let sum be a integer with sum = simmin + summax\n if sum + m <= n\n print Correct and newline\n return to indicate successful execution\n else do the following\n print Incorrect and newline\n return to indicate successful execution\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["2 1 1 2","1"],["Correct"]],[["3 1 1 3","2"],["Correct"]],[["2 1 1 3","2"],["Incorrect"]],[["3 1 1 5","3"],["Correct"]],[["3 2 1 5","1 5"],["Correct"]],[["3 2 1 5","1 1"],["Correct"]],[["3 2 1 5","5 5"],["Correct"]],[["3 2 1 5","1 6"],["Incorrect"]],[["3 2 5 10","1 10"],["Incorrect"]],[["6 5 3 6","4 4 4 4 4"],["Incorrect"]],[["100 50 68 97","20 42 93 1 98 6 32 11 48 46 82 96 24 73 40 100 99 10 55 87 65 80 97 54 59 48 30 22 16 92 66 2 22 60 23 81 64 60 34 60 99 99 4 70 91 99 30 20 41 96"],["Incorrect"]],[["100 50 1 2","1 1 2 1 1 2 2 1 1 1 1 1 2 2 1 2 1 2 2 1 1 1 2 2 2 1 1 2 1 1 1 1 2 2 1 1 1 1 1 2 1 1 1 2 1 2 2 2 1 2"],["Correct"]],[["100 99 1 2","2 1 1 1 2 2 1 1 1 2 2 2 1 2 1 1 2 1 1 2 1 2 2 1 2 1 2 1 2 1 2 2 2 2 1 1 1 1 1 2 1 2 2 1 2 2 2 1 1 1 1 1 2 2 2 2 1 2 2 1 1 1 2 1 1 2 1 1 2 1 2 1 2 1 1 1 1 2 1 1 1 1 1 2 2 2 1 1 1 1 2 2 2 2 1 1 2 2 2"],["Correct"]],[["3 2 2 100","40 1"],["Incorrect"]],[["3 2 2 3","4 4"],["Incorrect"]],[["5 2 2 4","2 2"],["Correct"]],[["5 1 1 4","1"],["Correct"]],[["9 7 1 4","4 3 3 2 2 4 1"],["Correct"]],[["9 5 2 3","4 2 4 3 3"],["Incorrect"]],[["6 3 1 3","1 4 2"],["Incorrect"]],[["3 2 1 99","34 100"],["Incorrect"]],[["4 2 1 99","100 38"],["Incorrect"]],[["5 2 1 99","100 38"],["Incorrect"]],[["4 2 1 99","36 51"],["Correct"]],[["7 6 3 10","5 10 7 7 4 5"],["Correct"]],[["8 6 3 10","8 5 7 8 4 4"],["Correct"]],[["9 6 3 10","9 7 7 5 3 10"],["Correct"]],[["16 15 30 40","36 37 35 36 34 34 37 35 32 33 31 38 39 38 38"],["Incorrect"]],[["17 15 30 40","38 36 37 34 30 38 38 31 38 38 36 39 39 37 35"],["Correct"]],[["18 15 30 40","35 37 31 32 30 33 36 38 36 38 31 30 39 32 36"],["Correct"]],[["17 16 30 40","39 32 37 31 40 32 36 34 56 34 40 36 37 36 33 36"],["Incorrect"]],[["18 16 30 40","32 35 33 39 34 30 37 34 30 34 39 18 32 37 37 36"],["Incorrect"]],[["19 16 30 40","36 30 37 30 37 32 34 30 35 35 33 35 39 37 46 37"],["Incorrect"]],[["2 1 2 100","38"],["Incorrect"]],[["3 1 2 100","1"],["Incorrect"]],[["4 1 2 100","1"],["Incorrect"]],[["91 38 1 3","3 2 3 2 3 2 3 3 1 1 1 2 2 1 3 2 3 1 3 3 1 3 3 2 1 2 2 3 1 2 1 3 2 2 3 1 1 2"],["Correct"]],[["4 3 2 10","6 3 10"],["Correct"]],[["41 6 4 10","10 7 4 9 9 10"],["Correct"]],[["21 1 1 9","9"],["Correct"]],[["2 1 9 10","10"],["Correct"]],[["2 1 2 9","9"],["Correct"]],[["8 7 5 9","6 7 8 5 5 6 6"],["Correct"]],[["3 2 2 8","7 2"],["Correct"]],[["71 36 1 10","7 10 8 1 3 8 5 7 3 10 8 1 6 4 5 7 8 2 4 3 4 10 8 5 1 2 8 8 10 10 4 3 7 9 7 8"],["Correct"]],[["85 3 4 9","4 8 7"],["Correct"]],[["4 3 4 10","9 10 5"],["Correct"]],[["2 1 1 5","1"],["Correct"]],[["91 75 1 10","2 6 9 7 4 9 4 8 10 6 4 1 10 6 5 9 7 5 1 4 6 4 8 2 1 3 5 7 6 9 5 5 8 1 7 1 4 2 8 3 1 6 6 2 10 6 2 2 8 5 4 5 5 3 10 9 4 3 1 9 10 3 2 4 8 7 4 9 3 1 1 1 3 4 5"],["Correct"]],[["10 4 1 8","7 9 6 6"],["Incorrect"]],[["18 1 3 10","2"],["Incorrect"]],[["6 2 4 8","6 3"],["Incorrect"]],[["17 6 2 8","3 8 6 1 6 4"],["Incorrect"]],[["21 1 5 8","4"],["Incorrect"]],[["2 1 1 10","9"],["Incorrect"]],[["2 1 4 8","5"],["Incorrect"]],[["2 1 1 7","6"],["Incorrect"]],[["2 1 4 9","5"],["Incorrect"]],[["2 1 3 8","7"],["Incorrect"]],[["2 1 5 9","6"],["Incorrect"]],[["3 2 1 10","4 9"],["Incorrect"]],[["2 1 4 10","7"],["Incorrect"]],[["2 1 2 9","8"],["Incorrect"]],[["2 1 3 9","3"],["Correct"]],[["3 2 6 7","6 6"],["Correct"]],[["6 4 1 10","11 10 9 1"],["Incorrect"]],[["7 6 3 8","3 4 5 6 7 8"],["Correct"]],[["5 3 1 5","2 3 4"],["Correct"]]]}} +{"instance_id":"pseudo_to_code_0.5k_173","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nn is an integer\nchair be a character array of size 10000\ndefine the main function\n read n\n a is an integer\n read input as chair+1\n let chair[0] be 0\n let chair[n+1] be 0\n let ans be integer with ans = 0\n if n=1 and chair[1]=0,\n print No and new line\n return to indicate successful execution\n end of the block\n if n=1 and chair[1]=1\n print Yes and new line\n return to indicate successful execution\n end of the block\n for integer i = 1 to n inclusive\n if chair[i] = 1 and either chair[i - 1] = 1 or chair[i + 1] =1\n let ans be 1\n stop\n end of the block\n if chair[i]=0,\n if chair[i - 1]= 0 and chair[i + 1] = 0,\n let ans be 1\n stop\n end of the block\n end of the block\n end of the block\n if ans equals 1,\n print No and new line\n else\n print yes and newline\nend of the block\n\n[CODE]:","reference_output":"int n;\nchar chair[10000];\nint main() {\n cin >> n;\n int a;\n cin >> (chair + 1);\n chair[0] = '0';\n chair[n + 1] = '0';\n int ans = 0;\n if (n == 1 && chair[1] == '0') {\n cout << \"No\" << endl;\n return 0;\n }\n if (n == 1 && chair[1] == '1') {\n cout << \"Yes\" << endl;\n return 0;\n }\n for (int i = 1; i <= n; i++) {\n if (chair[i] == '1' && (chair[i - 1] == '1' || chair[i + 1] == '1')) {\n ans = 1;\n break;\n }\n if (chair[i] == '0') {\n if (chair[i - 1] == '0' && chair[i + 1] == '0') {\n ans = 1;\n break;\n }\n }\n }\n if (ans == 1)\n cout << \"No\" << endl;\n else\n cout << \"Yes\" << endl;\n}","item":{"problem_id":"982A","pseudocode":"n is an integer\nchair be a character array of size 10000\ndefine the main function\n read n\n a is an integer\n read input as chair+1\n let chair[0] be 0\n let chair[n+1] be 0\n let ans be integer with ans = 0\n if n=1 and chair[1]=0,\n print No and new line\n return to indicate successful execution\n end of the block\n if n=1 and chair[1]=1\n print Yes and new line\n return to indicate successful execution\n end of the block\n for integer i = 1 to n inclusive\n if chair[i] = 1 and either chair[i - 1] = 1 or chair[i + 1] =1\n let ans be 1\n stop\n end of the block\n if chair[i]=0,\n if chair[i - 1]= 0 and chair[i + 1] = 0,\n let ans be 1\n stop\n end of the block\n end of the block\n end of the block\n if ans equals 1,\n print No and new line\n else\n print yes and newline\nend of the block","testcases":[[["3","101"],["Yes"]],[["4","1011"],["No"]],[["5","10001"],["No"]],[["1","0"],["No"]],[["1","1"],["Yes"]],[["100","0101001010101001010010010101001010100101001001001010010101010010101001001010101001001001010100101010"],["Yes"]],[["4","0100"],["No"]],[["42","011000100101001001101011011010100010011010"],["No"]],[["3","001"],["No"]],[["64","1001001010010010100101010010010100100101001001001001010100101001"],["Yes"]],[["3","111"],["No"]],[["4","0000"],["No"]],[["4","0001"],["No"]],[["4","0010"],["No"]],[["4","0011"],["No"]],[["4","0101"],["Yes"]],[["4","0110"],["No"]],[["4","0111"],["No"]],[["4","1000"],["No"]],[["4","1001"],["Yes"]],[["4","1010"],["Yes"]],[["4","1100"],["No"]],[["4","1101"],["No"]],[["4","1110"],["No"]],[["4","1111"],["No"]],[["2","00"],["No"]],[["2","01"],["Yes"]],[["2","10"],["Yes"]],[["2","11"],["No"]],[["3","000"],["No"]],[["3","010"],["Yes"]],[["3","011"],["No"]],[["3","100"],["No"]],[["3","110"],["No"]],[["100","0111001010101110001100000010011000100101110010001100111110101110001110101010111000010010011000000110"],["No"]],[["357","100101010010010010010100101001001010101010100100100100101001010101001010010100101001010100101001010010100100101001010101010101001001010100101010010100101001010100100100101010010010010100101010010010101001010010010101001001010010010101010100100101010010100100101001010100101001010100101001010010010010100101001010100100100100100100100101010101010010010100101"],["Yes"]],[["459","000111000101010000100001001010111110011011010001100101111010111011101110111101111101100101100011011001100110001001111001101000111001011100110100011111011111000010000110010011100110011011111110011100001101001111000100111011001000001011111100110100001001001100101011100001110110100101011011110100100111101011000101110000100110100100010000000100001001111111000011101010010011001111010111001100000100111001010111011010000011000011100101101011101000011011000110011"],["No"]],[["3","001"],["No"]],[["4","0010"],["No"]],[["3","111"],["No"]],[["4","0110"],["No"]],[["2","11"],["No"]],[["2","10"],["Yes"]],[["2","01"],["Yes"]],[["4","1101"],["No"]],[["2","00"],["No"]],[["4","1111"],["No"]],[["15","000010101010000"],["No"]],[["8","10010100"],["No"]],[["5","00100"],["No"]],[["6","100100"],["No"]],[["7","1000001"],["No"]],[["98","10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010"],["Yes"]]]}} +{"instance_id":"pseudo_to_code_0.5k_174","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n = integer\n read n\n xay = character array of size n\n z = integers with z = 0\n for i = 0 to n exclusive\n s = character\n read xay[i]\n if xay[i] and s\n increment z\n s = 0\n else\n s = 0\n end of the block\n s = xay[i]\n end of the block\n print z\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n char xay[n];\n int z = 0;\n for (int i = 0; i < n; i++) {\n char s;\n cin >> xay[i];\n if (xay[i] == s) {\n z++;\n s = '\\0';\n } else {\n s = '\\0';\n }\n s = xay[i];\n }\n cout << z << endl;\n}","item":{"problem_id":"266A","pseudocode":"define the main function\n n = integer\n read n\n xay = character array of size n\n z = integers with z = 0\n for i = 0 to n exclusive\n s = character\n read xay[i]\n if xay[i] and s\n increment z\n s = 0\n else\n s = 0\n end of the block\n s = xay[i]\n end of the block\n print z\nend of the block","testcases":[[["3","RRG"],["1"]],[["5","RRRRR"],["4"]],[["4","BRBG"],["0"]],[["1","B"],["0"]],[["2","BG"],["0"]],[["3","BGB"],["0"]],[["4","RBBR"],["1"]],[["5","RGGBG"],["1"]],[["10","GGBRBRGGRB"],["2"]],[["50","GRBGGRBRGRBGGBBBBBGGGBBBBRBRGBRRBRGBBBRBBRRGBGGGRB"],["18"]],[["15","BRRBRGGBBRRRRGR"],["6"]],[["20","RRGBBRBRGRGBBGGRGRRR"],["6"]],[["25","BBGBGRBGGBRRBGRRBGGBBRBRB"],["6"]],[["30","GRGGGBGGRGBGGRGRBGBGBRRRRRRGRB"],["9"]],[["35","GBBGBRGBBGGRBBGBRRGGRRRRRRRBRBBRRGB"],["14"]],[["40","GBBRRGBGGGRGGGRRRRBRBGGBBGGGBGBBBBBRGGGG"],["20"]],[["45","GGGBBRBBRRGRBBGGBGRBRGGBRBRGBRRGBGRRBGRGRBRRG"],["11"]],[["50","RBGGBGGRBGRBBBGBBGRBBBGGGRBBBGBBBGRGGBGGBRBGBGRRGG"],["17"]],[["50","GGGBBRGGGGGRRGGRBGGRGBBRBRRBGRGBBBGBRBGRGBBGRGGBRB"],["16"]],[["50","GBGRGRRBRRRRRGGBBGBRRRBBBRBBBRRGRBBRGBRBGGRGRBBGGG"],["19"]],[["10","GRRBRBRBGR"],["1"]],[["10","BRBGBGRRBR"],["1"]],[["20","GBGBGGRRRRGRBBGRGRGR"],["5"]],[["20","RRGGRBBGBBRBGRRBRRBG"],["6"]],[["30","BGBRGBBBGRGBBRGBGRBBBRGGRRGRRB"],["8"]],[["30","BBBBGGBRBGBBGBGBGBGGGRGRRGGBBB"],["11"]],[["40","GBRRGRBGBRRGBRGGGBRGBGBRGBBRRGRGGBBGBGBB"],["9"]],[["40","BRGRGGRGGRBBRRRBRBBGGGRRGBGBBGRBBRGBRRGG"],["13"]],[["50","RBGBGGRRGGRGGBGBGRRBGGBGBRRBBGBBGBBBGBBRBBRBRBRGRG"],["13"]],[["50","RBRRGBGRRRBGRRBGRRGRBBRBBRRBRGGBRBRRBGGRBGGBRBRGRB"],["12"]],[["2","BB"],["1"]],[["50","RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"],["49"]],[["50","RRRRRRRRGRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"],["47"]],[["50","RRRRRRRRRRRRGGRRRRRRRRRBRRRRRRRRRRRRRRBBRRRRRRRRRR"],["43"]]]}} +{"instance_id":"pseudo_to_code_0.5k_175","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, t, k, d = int\n read n then t then k then d\n limit = long long with limit = ((n + k - 1) \/ k - 1) * t\n if d is less than limit\n print \"YES\"\n else\n print \"NO\"\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, t, k, d;\n cin >> n >> t >> k >> d;\n long long limit = ((n + k - 1) \/ k - 1) * t;\n if (d < limit) {\n cout << \"YES\\n\";\n } else {\n cout << \"NO\\n\";\n }\n return 0;\n}","item":{"problem_id":"799A","pseudocode":"define the main function\n n, t, k, d = int\n read n then t then k then d\n limit = long long with limit = ((n + k - 1) \/ k - 1) * t\n if d is less than limit\n print \"YES\"\n else\n print \"NO\"\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["8 6 4 5"],["YES"]],[["8 6 4 6"],["NO"]],[["10 3 11 4"],["NO"]],[["4 2 1 4"],["YES"]],[["28 17 16 26"],["NO"]],[["60 69 9 438"],["NO"]],[["599 97 54 992"],["YES"]],[["11 22 18 17"],["NO"]],[["1 13 22 11"],["NO"]],[["1 1 1 1"],["NO"]],[["3 1 1 1"],["YES"]],[["1000 1000 1000 1000"],["NO"]],[["1000 1000 1 1"],["YES"]],[["1000 1000 1 400"],["YES"]],[["1000 1000 1 1000"],["YES"]],[["1000 1000 1 999"],["YES"]],[["53 11 3 166"],["YES"]],[["313 2 3 385"],["NO"]],[["214 9 9 412"],["NO"]],[["349 9 5 268"],["YES"]],[["611 16 8 153"],["YES"]],[["877 13 3 191"],["YES"]],[["340 9 9 10"],["YES"]],[["31 8 2 205"],["NO"]],[["519 3 2 148"],["YES"]],[["882 2 21 219"],["NO"]],[["982 13 5 198"],["YES"]],[["428 13 6 272"],["YES"]],[["436 16 14 26"],["YES"]],[["628 10 9 386"],["YES"]],[["77 33 18 31"],["YES"]],[["527 36 4 8"],["YES"]],[["128 18 2 169"],["YES"]],[["904 4 2 288"],["YES"]],[["986 4 3 25"],["YES"]],[["134 8 22 162"],["NO"]],[["942 42 3 69"],["YES"]],[["894 4 9 4"],["YES"]],[["953 8 10 312"],["YES"]],[["43 8 1 121"],["YES"]],[["12 13 19 273"],["NO"]],[["204 45 10 871"],["YES"]],[["342 69 50 425"],["NO"]],[["982 93 99 875"],["NO"]],[["283 21 39 132"],["YES"]],[["1000 45 83 686"],["NO"]],[["246 69 36 432"],["NO"]],[["607 93 76 689"],["NO"]],[["503 21 24 435"],["NO"]],[["1000 45 65 989"],["NO"]],[["30 21 2 250"],["YES"]],[["1000 49 50 995"],["NO"]],[["383 69 95 253"],["YES"]],[["393 98 35 999"],["YES"]],[["1000 22 79 552"],["NO"]],[["268 294 268 154"],["NO"]],[["963 465 706 146"],["YES"]],[["304 635 304 257"],["NO"]],[["4 2 1 6"],["NO"]],[["1 51 10 50"],["NO"]],[["5 5 4 4"],["YES"]],[["3 2 1 1"],["YES"]],[["3 4 3 3"],["NO"]],[["7 3 4 1"],["YES"]],[["101 10 1 1000"],["NO"]],[["5 1 1 1"],["YES"]],[["5 10 5 5"],["NO"]],[["19 1 7 1"],["YES"]],[["763 572 745 262"],["YES"]],[["1 2 1 1"],["NO"]],[["5 1 1 3"],["YES"]],[["170 725 479 359"],["NO"]],[["6 2 1 7"],["YES"]],[["6 2 5 1"],["YES"]],[["1 2 2 1"],["NO"]],[["24 2 8 3"],["YES"]],[["7 3 3 3"],["YES"]],[["5 2 2 2"],["YES"]],[["3 2 1 2"],["YES"]],[["1000 2 200 8"],["NO"]],[["3 100 2 100"],["NO"]],[["2 999 1 1000"],["NO"]],[["2 1 1 1"],["NO"]],[["2 3 5 1"],["NO"]],[["100 1 5 1"],["YES"]],[["7 2 3 3"],["YES"]],[["4 1 1 3"],["NO"]],[["3 2 2 1"],["YES"]],[["1 1 1 2"],["NO"]],[["91 8 7 13"],["YES"]],[["3 1 2 1"],["NO"]],[["5 3 2 3"],["YES"]],[["9 6 6 3"],["YES"]]]}} +{"instance_id":"pseudo_to_code_0.5k_176","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integers a, b, x\n read a read b\n create string array die_roll with size 6, with die_roll = {\"1\/6\", \"1\/3\", \"1\/2\", \"2\/3\", \"5\/6\", \"1\/1\"}\n set x to maximum of a and b\n print die_roll[6-x] print newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int a, b, x;\n cin >> a >> b;\n string die_roll[6] = {\"1\/6\", \"1\/3\", \"1\/2\", \"2\/3\", \"5\/6\", \"1\/1\"};\n x = max(a, b);\n cout << die_roll[6 - x] << endl;\n return 0;\n}","item":{"problem_id":"9A","pseudocode":"define the main function\n create integers a, b, x\n read a read b\n create string array die_roll with size 6, with die_roll = {\"1\/6\", \"1\/3\", \"1\/2\", \"2\/3\", \"5\/6\", \"1\/1\"}\n set x to maximum of a and b\n print die_roll[6-x] print newline\n return to indicate successful execution\nend of the block","testcases":[[["4 2"],["1\/2"]],[["1 1"],["1\/1"]],[["1 2"],["5\/6"]],[["1 3"],["2\/3"]],[["1 4"],["1\/2"]],[["1 5"],["1\/3"]],[["1 6"],["1\/6"]],[["2 1"],["5\/6"]],[["2 2"],["5\/6"]],[["2 3"],["2\/3"]],[["2 4"],["1\/2"]],[["2 5"],["1\/3"]],[["2 6"],["1\/6"]],[["3 1"],["2\/3"]],[["3 2"],["2\/3"]],[["3 3"],["2\/3"]],[["3 4"],["1\/2"]],[["3 5"],["1\/3"]],[["3 6"],["1\/6"]],[["4 1"],["1\/2"]],[["4 3"],["1\/2"]],[["4 4"],["1\/2"]],[["4 5"],["1\/3"]],[["4 6"],["1\/6"]],[["5 1"],["1\/3"]],[["5 2"],["1\/3"]],[["5 3"],["1\/3"]],[["5 4"],["1\/3"]],[["5 5"],["1\/3"]],[["5 6"],["1\/6"]],[["6 1"],["1\/6"]],[["6 2"],["1\/6"]],[["6 3"],["1\/6"]],[["6 4"],["1\/6"]],[["6 5"],["1\/6"]],[["6 6"],["1\/6"]]]}} +{"instance_id":"pseudo_to_code_0.5k_177","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create integer test with test = 1\n while decrement test is true\n create integers n, m, i, j, x, y, s, k, q, a, b, c with c = 0\n create long long integer sum with sum = 0\n read n\n for i = 0 to n exclusive\n read k\n increment sum by k\n set c to maximum of c and k\n end of the block\n set j to 1 if sum % ( n - 1 ) is greater than 0, else 0\n set sum to sum \/ ( n - 1 ) + j\n set sum to sum if sum is greater than c, else c\n print sum print \"\\n\"\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int test = 1;\n while (test--) {\n int n, m, i, j, x, y, s, k, q, a, b, c = 0;\n long long int sum = 0;\n cin >> n;\n for (i = 0; i < n; i++) {\n cin >> k;\n sum += k;\n c = max(c, k);\n }\n j = sum % (n - 1) > 0 ? 1 : 0;\n sum = sum \/ (n - 1) + j;\n sum = sum > c ? sum : c;\n cout << sum << \"\\n\";\n }\n return 0;\n}","item":{"problem_id":"348A","pseudocode":"define the main function\n create integer test with test = 1\n while decrement test is true\n create integers n, m, i, j, x, y, s, k, q, a, b, c with c = 0\n create long long integer sum with sum = 0\n read n\n for i = 0 to n exclusive\n read k\n increment sum by k\n set c to maximum of c and k\n end of the block\n set j to 1 if sum % ( n - 1 ) is greater than 0, else 0\n set sum to sum \/ ( n - 1 ) + j\n set sum to sum if sum is greater than c, else c\n print sum print \"\\n\"\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["3","3 2 2"],["4"]],[["4","2 2 2 2"],["3"]],[["7","9 7 7 8 8 7 8"],["9"]],[["10","13 12 10 13 13 14 10 10 12 12"],["14"]],[["10","94 96 91 95 99 94 96 92 95 99"],["106"]],[["100","1 555 876 444 262 234 231 598 416 261 206 165 181 988 469 123 602 592 533 97 864 716 831 156 962 341 207 377 892 51 866 96 757 317 832 476 549 472 770 1000 887 145 956 515 992 653 972 677 973 527 984 559 280 346 580 30 372 547 209 929 492 520 446 726 47 170 699 560 814 206 688 955 308 287 26 102 77 430 262 71 415 586 532 562 419 615 732 658 108 315 268 574 86 12 23 429 640 995 342 305"],["1000"]],[["3","1 1 1"],["2"]],[["30","94 93 90 94 90 91 93 91 93 94 93 90 100 94 97 94 94 95 94 96 94 98 97 95 97 91 91 95 98 96"],["100"]],[["5","1000000000 5 5 4 4"],["1000000000"]],[["3","1 2 1"],["2"]],[["3","2 1 1"],["2"]],[["4","1 2 3 4"],["4"]],[["3","1000000000 1000000000 10000000"],["1005000000"]],[["3","677876423 834056477 553175531"],["1032554216"]],[["5","1000000000 1 1 1 1"],["1000000000"]],[["4","1000000000 1000000000 1000000000 1000000000"],["1333333334"]],[["3","4 10 11"],["13"]],[["5","1000000000 1000000000 1000000000 1000000000 1000000000"],["1250000000"]]]}} +{"instance_id":"pseudo_to_code_0.5k_178","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nfunction bigmod with long long arguments a, p and m that returns long long\n if p = 0, return 1 modulo m\n declare new long long called x = result of bigmod(a, p\/2, m)\n change x to x squared % m\n if p is odd, assign (x * a) modulo m to x\n return x modulo m\nend of the block\ncreate an array of long longs m with 256 elements, q with 266 elements and 2d array v with size 10009 by 266\ndefine the main function\n create new strings a and b\n read input to a and b\n prepend \" \" to a\n start for loop from i = 'a' to 'z' inclusive, setting q[i] to length of a on each loop iteration\n start for loop from i = length of a to 0 inclusive decrementing i\n assign value of 1 to m[a[i]]\n in a for loop, change j from 'a' to 'z' inclusive, assigning q[j] to v[i][j] on each iteration\n set value of q[a[i]] to i\n end of the block\n declare new long longs c = 0 and an = 1\n for i from 0 to length of b - 1 inclusive incrementing i\n if m[b[i]] is equal to 0, return 0 and print \"-1\"\n assign v[c][b[i]] to c\n if c = length of a\n increment an\n change c to v[0][b[i]]\n end of the block\n end of the block\n print an to the standard output\nend of the block\n\n[CODE]:","reference_output":"long long bigmod(long long a, long long p, long long m) {\n if (p == 0) return 1 % m;\n long long x = bigmod(a, p \/ 2, m);\n x = (x * x) % m;\n if (p % 2) x = (x * a) % m;\n return x % m;\n}\nlong long v[10009][266], q[266], m[256];\nint main() {\n string a, b;\n cin >> a >> b;\n a = \" \" + a;\n for (int i = 'a'; i <= 'z'; i++) q[i] = a.size();\n for (int i = a.size(); i >= 0; i--) {\n m[a[i]] = 1;\n for (int j = 'a'; j <= 'z'; j++) v[i][j] = q[j];\n q[a[i]] = i;\n }\n long long c = 0, an = 1;\n for (int i = 0; i <= b.size() - 1; i++) {\n if (m[b[i]] == 0) return 0 & puts(\"-1\");\n c = v[c][b[i]];\n if (c == a.size()) {\n an++;\n c = v[0][b[i]];\n }\n }\n cout << an << endl;\n}","item":{"problem_id":"91A","pseudocode":"function bigmod with long long arguments a, p and m that returns long long\n if p = 0, return 1 modulo m\n declare new long long called x = result of bigmod(a, p\/2, m)\n change x to x squared % m\n if p is odd, assign (x * a) modulo m to x\n return x modulo m\nend of the block\ncreate an array of long longs m with 256 elements, q with 266 elements and 2d array v with size 10009 by 266\ndefine the main function\n create new strings a and b\n read input to a and b\n prepend \" \" to a\n start for loop from i = 'a' to 'z' inclusive, setting q[i] to length of a on each loop iteration\n start for loop from i = length of a to 0 inclusive decrementing i\n assign value of 1 to m[a[i]]\n in a for loop, change j from 'a' to 'z' inclusive, assigning q[j] to v[i][j] on each iteration\n set value of q[a[i]] to i\n end of the block\n declare new long longs c = 0 and an = 1\n for i from 0 to length of b - 1 inclusive incrementing i\n if m[b[i]] is equal to 0, return 0 and print \"-1\"\n assign v[c][b[i]] to c\n if c = length of a\n increment an\n change c to v[0][b[i]]\n end of the block\n end of the block\n print an to the standard output\nend of the block","testcases":[[["abc","xyz"],["-1"]],[["abcd","dabc"],["2"]],[["ab","babaaab"],["5"]],[["ab","baaabba"],["6"]],[["fbaaigiihhfaahgdbddgeggjdeigfadhfddja","hbghjgijijcdafcbgiedichdeebaddfddb"],["-1"]],[["ibifgcfdbfdhihbifageaaadegbfbhgeebgdgiafgedchdg","dedfebcfdigdefdediigcfcafbhhiacgfbeccfchd"],["7"]],[["fcagdciidcedeaicgfffgjefaefaachfbfj","aiecchjehdgbjfcdjdefgfhiddjajeddiigidaibejabd"],["11"]],[["ehfjaabjfedhddejjfcfijagefhjeahjcddhchahjbagi","fbfdjbjhibjgjgaaajgdbcfdbhjcajcbbieijhcjgajhgaa"],["10"]],[["ifjcedhjhdjhbiaededfefagigggcebfaebf","geibbffgeefbaghdbfidbbhabdbdgej"],["9"]],[["eidfdfbbgjigghaddbjhcbdechecgghjgfjjcajjhaghdhd","fcgecaefhgjjegbhjeaffcabifihhcadaibhi"],["11"]]]}} +{"instance_id":"pseudo_to_code_0.5k_179","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n str is a new array of characters with 100 elements\n declare integers dif and ans with ans = 0\n read str\n declare new integer called len = length of str\n declare character cur = 'a'\n in a for loop, change i from 0 to len exclusive\n assign absoluve value of str[i] - cur to dif\n change ans to ans + min of dif and 26 - dif\n assign str[i] to cur\n end of the block\n print ans\nend of the block\n\n[CODE]:","reference_output":"int main() {\n char str[100];\n int dif, ans = 0;\n gets(str);\n int len = strlen(str);\n char cur = 'a';\n for (int i = 0; i < len; i++) {\n dif = abs(str[i] - cur);\n ans += min(dif, 26 - dif);\n cur = str[i];\n }\n cout << ans << endl;\n}","item":{"problem_id":"731A","pseudocode":"define the main function\n str is a new array of characters with 100 elements\n declare integers dif and ans with ans = 0\n read str\n declare new integer called len = length of str\n declare character cur = 'a'\n in a for loop, change i from 0 to len exclusive\n assign absoluve value of str[i] - cur to dif\n change ans to ans + min of dif and 26 - dif\n assign str[i] to cur\n end of the block\n print ans\nend of the block","testcases":[[["zeus"],["18"]],[["map"],["35"]],[["ares"],["34"]],[["l"],["11"]],[["abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv"],["99"]],[["gngvi"],["44"]],[["aaaaa"],["0"]],[["a"],["0"]],[["z"],["1"]],[["vyadeehhikklnoqrs"],["28"]],[["jjiihhhhgggfedcccbazyxx"],["21"]],[["fyyptqqxuciqvwdewyppjdzur"],["117"]],[["fqcnzmzmbobmancqcoalzmanaobpdse"],["368"]],[["zzzzzaaaaaaazzzzzzaaaaaaazzzzzzaaaazzzza"],["8"]],[["aucnwhfixuruefkypvrvnvznwtjgwlghoqtisbkhuwxmgzuljvqhmnwzisnsgjhivnjmbknptxatdkelhzkhsuxzrmlcpeoyukiy"],["644"]],[["sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"],["8"]],[["nypjygrdtpzpigzyrisqeqfriwgwlengnezppgttgtndbrryjdl"],["421"]],[["pnllnnmmmmoqqqqqrrtssssuuvtsrpopqoonllmonnnpppopnonoopooqpnopppqppqstuuuwwwwvxzxzzaa"],["84"]],[["btaoahqgxnfsdmzsjxgvdwjukcvereqeskrdufqfqgzqfsftdqcthtkcnaipftcnco"],["666"]],[["eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrwwwwwwwwww"],["22"]],[["uyknzcrwjyzmscqucclvacmorepdgmnyhmakmmnygqwglrxkxhkpansbmruwxdeoprxzmpsvwackopujxbbkpwyeggsvjykpxh"],["643"]],[["gzwpooohffcxwtpjgfzwtooiccxsrrokezutoojdzwsrmmhecaxwrojcbyrqlfdwwrliiib"],["245"]],[["dbvnkktasjdwqsrzfwwtmjgbcxggdxsoeilecihduypktkkbwfbruxzzhlttrssicgdwqruddwrlbtxgmhdbatzvdxbbro"],["468"]],[["mdtvowlktxzzbuaeiuebfeorgbdczauxsovbucactkvyvemsknsjfhifqgycqredzchipmkvzbxdjkcbyukomjlzvxzoswumned"],["523"]],[["kkkkkkkaaaaxxaaaaaaaxxxxxxxxaaaaaaxaaaaaaaaaakkkkkkkkkaaaaaaannnnnxxxxkkkkkkkkaannnnnnna"],["130"]],[["dffiknqqrsvwzcdgjkmpqtuwxadfhkkkmpqrtwxyadfggjmpppsuuwyyzcdgghhknnpsvvvwwwyabccffiloqruwwyyzabeeehh"],["163"]],[["qpppmmkjihgecbyvvsppnnnkjiffeebaaywutrrqpmkjhgddbzzzywtssssqnmmljheddbbaxvusrqonmlifedbbzyywwtqnkheb"],["155"]],[["wvvwwwvvwxxxyyyxxwwvwwvuttttttuvvwxxwxxyxxwwwwwvvuttssrssstsssssrqpqqppqrssrsrrssrssssrrsrqqrrqpppqp"],["57"]],[["dqcpcobpcobnznamznamzlykxkxlxlylzmaobnaobpbnanbpcoaobnboaoboanzlymzmykylymylzlylymanboanaocqdqesfrfs"],["1236"]],[["nnnnnnnnnnnnnnnnnnnnaaaaaaaaaaaaaaaaaaaakkkkkkkkkkkkkkkkkkkkkkaaaaaaaaaaaaaaaaaaaaxxxxxxxxxxxxxxxxxx"],["49"]],[["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"],["0"]],[["cgilqsuwzaffilptwwbgmnttyyejkorxzflqvzbddhmnrvxchijpuwaeiimosxyycejlpquuwbfkpvbgijkqvxybdjjjptxcfkqt"],["331"]],[["ufsepwgtzgtgjssxaitgpailuvgqweoppszjwhoxdhhhpwwdorwfrdjwcdekxiktwziqwbkvbknrtvajpyeqbjvhiikxxaejjpte"],["692"]],[["uhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuh"],["1293"]],[["vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvgggggggggggggggggggggggggggggggggggggggggggggggggg"],["16"]],[["lyidmjyzbszgiwkxhhpnnthfwcvvstueionspfrvqgkvngmwyhezlosrpdnbvtcjjxxsykixwnepbumaacdzadlqhnjlcejovple"],["616"]],[["etzqqbaveffalkdguunfmyyrzkccnxmlluxeasqmopxzfvlkbhipqdwjgrttoemruohgwukfisdhznqyvhswbbypoxgtxyappcrl"],["605"]],[["lizussgedcbdjhrbeskhgatyozvwwekanlggcstijrniivupmcoofbaxfqrxddyzzptwxcftlhajsmmkkriarrqtkoauhcqefyud"],["549"]],[["dvjuvgfdogpknmbowlsfjzcimnygbtjiucyeeroqwhmzwpjqxlbjkqawrdtmvxbiqufllfuqibxvmtdrwaqkjblxqjpwzmhwqore"],["688"]],[["eeycuijtbgynmiczjfslwobmnkpgodfgvujvduyfeqchuaoktqrrairkkmmsjahltfcxwtpzzyddxrqfxabfoocmpuviinrjitsc"],["604"]],[["cgglnakewwvzoytaghksebrhjdbcdegssuzilrcppayxtgxopybbwshvyqnzhdsifkuwghourmeottrgjwdqpihbklvfzxpomqsa"],["572"]],[["aexullmxncckzryymfnuugdklaffevabqqztelpvojecljnhqldazdcaamubpenwxikysxxjjctvbndprsolzehywmgnvkgqvrfp"],["609"]],[["psnoieutsvvcwfhtnnphhxkwigzsbzyjmdiyl"],["223"]],[["aa"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_180","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n = integer\n read n\n C = boolean array of sizes 5, 5 with C = {}\n color = string = \"RGBYW\"\n value = string = \"12345\"\n for i = 0 to n exclusive\n declare a string c\n read c\n for i = 0 to 5 exclusive\n for j = 0 to 5 exclusive\n if c[0] equals color[i] and c[1] equals value[j], set C[i][j] to true\n end of the block\n ans = integer set to 25\n for bc = 0 as long as bc is less than 1 shifted left 5 bits with increment bc + 1\n for bv = 0 as long as bv is less than 1 shifted left 5 bits with increment bv + 1\n ok = boolean = true\n for c = 0 to 5 exclusive\n if bc shifted left c bitwise and 1 bits\n t = integer = 0\n for v = 0 to 5 exclusive\n if bv shifted right v bitwise and 1 bits is false, add integer value of C[c][v] to t\n if t is greater than 1, set ok to false\n end of the block\n for v = 0 to 5 exclusive\n if bv shifted right v bitwise and 1 bits\n t = integer = 0\n for c = 0 to 5 exclusive\n if bc shifted right c bitwise and 1 bits is false, add integer value of C[c][v] to t\n if t is greater than 1, set ok to false\n end of the block\n t = integer = 0\n for c = 0 to 5 exclusive\n for v = 0 to 5 exclusive\n if not (bc shifted right c bitwise and 1 bits) and not (bv shifted right v bitwise and 1 bits), add integer value of C[c][v] to t\n if t is greater than 1, set ok to false\n if ok\n a = integer set to 0\n for i = 0 to 5 exclusive, add (bc shifted right i bitwise and 1 bits) + (bv shifted right i bitwise and 1 bits) to a\n set ans to call min with ans, a\n end of the block\n end of the block\n display ans\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n bool C[5][5] = {};\n string color = \"RGBYW\";\n string value = \"12345\";\n for (int i = 0; i < n; i++) {\n string c;\n cin >> c;\n for (int i = 0; i < 5; i++)\n for (int j = 0; j < 5; j++)\n if (c[0] == color[i] && c[1] == value[j]) C[i][j] = true;\n }\n int ans = 25;\n for (int bc = 0; bc < 1 << 5; bc++)\n for (int bv = 0; bv < 1 << 5; bv++) {\n bool ok = true;\n for (int c = 0; c < 5; c++)\n if (bc >> c & 1) {\n int t = 0;\n for (int v = 0; v < 5; v++)\n if (!(bv >> v & 1)) t += (int)C[c][v];\n if (t > 1) ok = false;\n }\n for (int v = 0; v < 5; v++)\n if (bv >> v & 1) {\n int t = 0;\n for (int c = 0; c < 5; c++)\n if (!(bc >> c & 1)) t += (int)C[c][v];\n if (t > 1) ok = false;\n }\n int t = 0;\n for (int c = 0; c < 5; c++)\n for (int v = 0; v < 5; v++)\n if (!(bc >> c & 1) && !(bv >> v & 1)) t += (int)C[c][v];\n if (t > 1) ok = false;\n if (ok) {\n int a = 0;\n for (int i = 0; i < 5; i++) a += (bc >> i & 1) + (bv >> i & 1);\n ans = min(ans, a);\n }\n }\n cout << ans << endl;\n}","item":{"problem_id":"442A","pseudocode":"define the main function\n n = integer\n read n\n C = boolean array of sizes 5, 5 with C = {}\n color = string = \"RGBYW\"\n value = string = \"12345\"\n for i = 0 to n exclusive\n declare a string c\n read c\n for i = 0 to 5 exclusive\n for j = 0 to 5 exclusive\n if c[0] equals color[i] and c[1] equals value[j], set C[i][j] to true\n end of the block\n ans = integer set to 25\n for bc = 0 as long as bc is less than 1 shifted left 5 bits with increment bc + 1\n for bv = 0 as long as bv is less than 1 shifted left 5 bits with increment bv + 1\n ok = boolean = true\n for c = 0 to 5 exclusive\n if bc shifted left c bitwise and 1 bits\n t = integer = 0\n for v = 0 to 5 exclusive\n if bv shifted right v bitwise and 1 bits is false, add integer value of C[c][v] to t\n if t is greater than 1, set ok to false\n end of the block\n for v = 0 to 5 exclusive\n if bv shifted right v bitwise and 1 bits\n t = integer = 0\n for c = 0 to 5 exclusive\n if bc shifted right c bitwise and 1 bits is false, add integer value of C[c][v] to t\n if t is greater than 1, set ok to false\n end of the block\n t = integer = 0\n for c = 0 to 5 exclusive\n for v = 0 to 5 exclusive\n if not (bc shifted right c bitwise and 1 bits) and not (bv shifted right v bitwise and 1 bits), add integer value of C[c][v] to t\n if t is greater than 1, set ok to false\n if ok\n a = integer set to 0\n for i = 0 to 5 exclusive, add (bc shifted right i bitwise and 1 bits) + (bv shifted right i bitwise and 1 bits) to a\n set ans to call min with ans, a\n end of the block\n end of the block\n display ans\nend of the block","testcases":[[["2","G3 G3"],["0"]],[["4","G4 R4 R3 B3"],["2"]],[["5","B1 Y1 W1 G1 R1"],["4"]],[["10","Y4 B1 R3 G5 R5 W3 W5 W2 R1 Y1"],["6"]],[["3","G4 G3 B4"],["2"]],[["2","W3 Y5"],["1"]],[["2","W5 Y5"],["1"]],[["100","W4 Y1 W5 R4 W3 Y1 R4 W2 G3 G1 B5 Y5 Y2 Y3 G4 B5 W1 G5 Y5 Y3 G2 Y5 Y5 G5 R2 B3 B1 W5 Y1 W5 B4 W4 R4 B1 R1 W3 R5 R4 G2 W3 W3 R2 W5 Y2 B2 R3 R3 Y1 G5 G2 Y1 R4 Y5 W5 G5 B3 W2 R1 B2 W2 W2 Y5 W3 G1 B1 G2 Y3 W3 G1 W5 W1 G5 G2 Y1 W5 B5 W4 Y5 G2 R3 B4 R5 B1 R1 B4 Y4 Y4 Y3 R5 Y3 B3 W5 R5 Y5 G2 G5 W5 B4 G4 W5"],["8"]],[["100","B5 G3 Y2 W3 W1 G1 Y4 G3 G4 B5 W4 B5 Y3 R5 B4 G4 G4 B1 G1 R5 G4 B4 G1 G2 W1 Y4 R5 Y3 W5 W4 Y5 W1 B4 G3 R2 R3 W1 B4 Y4 G2 G2 R1 Y5 W1 Y3 B3 G5 Y3 G3 W2 W5 Y4 B2 Y5 R4 B2 Y3 W4 G2 G3 R2 W1 B4 B2 B1 Y2 Y2 Y3 W3 Y5 W1 R1 R1 R4 R4 R4 Y1 Y3 B2 Y3 Y1 R3 G4 G4 Y5 B5 W2 G1 G5 B3 G1 Y1 R2 G5 R2 Y5 R5 Y4 R4 W2"],["8"]],[["100","Y3 Y3 Y5 Y2 Y4 Y1 Y2 Y3 Y1 Y5 Y3 Y1 Y4 Y5 Y5 Y3 Y1 Y5 Y2 Y3 Y1 Y4 Y4 Y1 Y2 Y2 Y4 Y2 Y4 Y5 Y5 Y2 Y3 Y1 Y3 Y5 Y3 Y1 Y5 Y3 Y3 Y2 Y5 Y1 Y5 Y5 Y4 Y2 Y2 Y1 Y2 Y4 Y3 Y2 Y5 Y3 Y4 Y3 Y1 Y4 Y2 Y4 Y4 Y3 Y3 Y1 Y1 Y4 Y2 Y5 Y3 Y4 Y4 Y4 Y3 Y2 Y2 Y2 Y3 Y4 Y4 Y2 Y1 Y2 Y2 Y4 Y3 Y5 Y4 Y2 Y5 Y3 Y1 Y5 Y2 Y5 Y4 Y1 Y2 Y1"],["4"]],[["100","G3 B3 G3 Y3 R3 G3 R3 G3 W3 B3 B3 B3 R3 Y3 Y3 W3 R3 B3 G3 W3 G3 W3 Y3 R3 Y3 W3 W3 G3 W3 G3 W3 Y3 G3 R3 Y3 W3 W3 Y3 Y3 Y3 R3 W3 R3 G3 W3 W3 G3 Y3 B3 W3 B3 Y3 G3 Y3 B3 Y3 W3 Y3 R3 Y3 R3 W3 W3 W3 G3 Y3 G3 R3 B3 R3 Y3 R3 Y3 R3 Y3 R3 Y3 R3 W3 Y3 R3 W3 W3 W3 G3 G3 Y3 B3 Y3 R3 G3 G3 B3 B3 Y3 R3 G3 R3 W3 G3"],["4"]],[["100","W5 Y5 Y3 W3 Y5 Y5 W5 W5 Y3 W5 Y5 Y3 W5 Y5 W5 W3 Y3 Y5 W3 W5 Y5 W3 Y5 Y3 W3 W3 Y3 Y5 W3 W3 Y3 Y5 W3 Y5 Y5 Y5 W5 Y5 W5 Y5 W5 W5 W3 W5 W3 Y3 W5 W3 W3 W5 Y3 Y5 W5 W5 W3 W5 W5 Y5 W5 W3 W3 W3 Y3 Y5 Y5 Y3 Y5 W5 W5 Y5 W3 W3 W5 Y5 Y5 Y3 W5 W5 W3 Y5 W3 W5 Y3 Y5 W5 Y3 Y3 W3 Y3 Y5 Y3 Y3 W5 Y5 Y3 Y5 Y3 W3 Y3 W5"],["2"]],[["100","Y5 Y5 Y3 Y5 Y3 Y5 Y5 Y5 Y3 Y3 Y5 Y3 Y3 Y5 Y3 Y3 Y5 Y3 Y3 Y5 Y3 Y5 Y5 Y3 Y3 Y5 Y3 Y5 Y3 Y3 Y3 Y5 Y3 Y3 Y3 Y3 Y3 Y3 Y3 Y5 Y5 Y5 Y5 Y3 Y5 Y5 Y5 Y5 Y3 Y3 Y3 Y5 Y5 Y3 Y3 Y3 Y5 Y3 Y3 Y5 Y3 Y3 Y3 Y5 Y3 Y5 Y5 Y5 Y5 Y3 Y3 Y5 Y5 Y5 Y5 Y5 Y5 Y5 Y5 Y3 Y5 Y5 Y5 Y5 Y5 Y5 Y3 Y5 Y3 Y5 Y5 Y5 Y5 Y5 Y5 Y3 Y3 Y3 Y5 Y5"],["1"]],[["100","Y3 Y3 Y3 W3 W3 Y3 Y3 W3 Y3 Y3 W3 Y3 Y3 Y3 W3 Y3 Y3 W3 Y3 Y3 Y3 W3 Y3 W3 W3 W3 W3 W3 Y3 Y3 W3 Y3 Y3 W3 W3 Y3 Y3 W3 Y3 Y3 W3 W3 W3 W3 W3 Y3 Y3 Y3 Y3 W3 Y3 Y3 W3 W3 W3 Y3 W3 W3 W3 Y3 Y3 Y3 Y3 W3 W3 W3 W3 W3 Y3 Y3 W3 Y3 W3 Y3 Y3 Y3 Y3 Y3 Y3 Y3 W3 W3 W3 W3 Y3 W3 Y3 Y3 Y3 Y3 Y3 Y3 Y3 Y3 W3 Y3 Y3 W3 W3 Y3"],["1"]],[["10","W1 Y4 Y3 W3 Y2 W2 W1 Y2 Y3 W3"],["3"]],[["10","W2 R2 B5 W5 W2 B3 B2 R5 Y5 R2"],["5"]],[["5","W3 Y5 W2 G3 Y3"],["3"]],[["5","W5 G5 W2 Y5 G2"],["3"]],[["5","W5 W3 Y3 Y5 W2"],["3"]],[["5","Y5 W3 W2 G5 W3"],["3"]],[["5","G5 G3 G5 G5 W2"],["2"]],[["5","W2 Y2 G3 G3 G3"],["2"]],[["5","G3 Y5 Y2 Y5 W3"],["3"]],[["5","W3 W5 Y3 W2 G5"],["3"]],[["5","Y3 Y2 Y3 Y5 Y5"],["2"]],[["5","W5 Y3 W5 W5 Y5"],["2"]],[["5","G3 Y3 G3 Y3 G3"],["1"]],[["5","G4 W5 Y4 Y4 R5"],["3"]],[["5","G3 R2 R5 B3 W4"],["4"]],[["5","W2 G5 W3 R4 R4"],["3"]],[["5","Y3 Y3 G3 Y3 W3"],["2"]],[["5","W5 W5 W3 Y3 Y5"],["2"]],[["35","G5 G5 G3 G2 G3 Y3 W3 Y3 G5 W5 G2 G2 W5 G5 G5 W3 G3 G2 Y3 W5 W3 G5 W5 G2 Y2 Y3 W5 G3 W3 W2 G2 W3 Y2 G3 G3"],["4"]],[["35","G3 G2 G5 G2 W2 G3 W2 W5 Y5 G5 W2 W2 W2 G5 Y2 G5 W5 W3 W2 Y2 G5 W5 W3 W5 Y2 Y5 W2 W2 W3 Y3 G2 W3 G5 G3 W2"],["4"]],[["35","W2 W3 Y2 G5 G2 W3 G5 Y2 W5 Y5 W3 G2 G3 W5 W2 W3 Y2 Y5 Y2 Y5 Y2 Y2 G2 Y5 W3 Y5 G3 Y2 G3 Y2 Y5 W5 G3 W5 W5"],["4"]],[["35","Y2 Y3 Y2 Y3 Y5 Y5 Y3 Y5 Y5 Y2 Y2 Y5 Y2 Y2 Y5 Y3 Y2 Y5 Y5 Y3 Y3 Y2 Y2 Y2 Y3 Y5 Y2 Y5 Y5 Y3 Y5 Y2 Y3 Y3 Y2"],["2"]],[["35","Y5 Y5 W5 Y5 W3 Y3 W5 W3 W5 W3 W5 Y5 Y3 W3 W5 W5 W5 W3 Y5 Y3 Y5 W5 W5 Y3 Y5 Y5 Y3 W5 W3 W3 W3 W5 Y5 W3 W5"],["2"]],[["35","G3 G3 W3 W3 G3 G3 Y3 G3 Y3 Y3 G3 W3 Y3 G3 W3 Y3 W3 Y3 Y3 Y3 Y3 G3 G3 Y3 Y3 G3 G3 G3 G3 G3 Y3 W3 W3 W3 G3"],["2"]],[["35","R2 R2 R2 R2 G3 G2 Y3 G2 R3 W5 G4 Y3 Y3 G2 Y5 W5 G4 G2 W4 Y2 W3 R5 W5 G4 G4 Y2 G2 Y5 G2 Y4 W3 G5 G2 R3 G4"],["6"]],[["35","G2 Y1 Y1 R4 G5 B5 R2 G4 G2 G3 W4 W1 B3 W5 R2 Y5 R4 R4 B5 Y2 B4 B1 R3 G4 Y3 G2 R4 G3 B2 G2 R3 B2 R1 W2 B4"],["8"]],[["35","W4 Y5 Y3 Y3 R5 W3 R5 W2 R5 Y2 R2 Y2 G2 G3 Y4 Y4 R4 Y3 G2 W2 R2 R3 Y3 W5 W2 G4 R3 R3 W2 W5 Y4 R3 W2 R4 R2"],["6"]],[["35","Y3 Y3 Y3 Y3 Y3 Y3 W3 G3 G3 G3 W3 G3 G3 Y3 Y3 W3 G3 G3 Y3 W3 W3 Y3 Y3 G3 W3 W3 G3 Y3 Y3 W3 G3 W3 G3 W3 G3"],["2"]],[["35","W3 Y3 W3 W5 Y5 W3 W3 Y5 W3 W3 W3 W5 W3 Y3 Y5 Y3 Y5 Y3 W3 W3 W5 W5 W3 Y5 W3 W3 Y3 W3 W5 W3 Y3 Y3 Y5 Y5 Y3"],["2"]],[["25","Y3 R2 R2 Y2 Y5 Y4 B3 B3 Y4 W3 R1 W3 W5 B5 R1 Y4 B4 B5 B3 G3 B1 R2 R4 G5 Y5"],["7"]],[["25","W5 R1 Y3 G5 G3 G5 W2 Y1 R3 R4 B3 G5 G2 Y2 W1 G2 Y1 B4 Y2 G3 G3 Y4 W3 W5 Y2"],["7"]],[["25","Y1 W2 G3 W1 G1 G3 G4 W1 B2 W3 R4 B1 G2 Y4 G1 R2 R3 Y4 B2 G4 W2 Y2 R2 Y5 R4"],["7"]],[["25","B3 Y1 R3 Y3 R5 B4 B3 G1 R1 B4 B5 W3 R4 W1 B3 Y3 B3 Y4 B2 G5 Y1 G5 R4 B5 Y1"],["7"]],[["25","G4 R4 Y1 Y4 R3 B5 W2 G4 B5 B2 G1 B4 R4 G2 Y3 Y4 G5 Y3 R1 G2 Y5 G3 Y3 Y4 W3"],["8"]],[["25","R1 R3 G1 B5 Y5 W3 R4 R4 R1 G3 R2 W1 B1 G2 W2 G4 R2 W3 B1 W3 B5 Y5 R2 B4 B5"],["7"]],[["5","W3 B1 Y1 R3 Y5"],["3"]],[["4","R1 R2 G1 Y5"],["2"]],[["4","R1 R2 G1 B3"],["2"]],[["15","Y3 R4 G1 W1 R3 R2 W4 W1 R5 Y4 G3 R5 Y2 W1 Y1"],["6"]],[["4","G5 W5 W4 R3"],["2"]]]}} +{"instance_id":"pseudo_to_code_0.5k_181","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, k, x, y, z = long long\n read n, k\n x = n \/ 2\n if (k + 1) > x\n print 0,\" \",0,\" \",n\n else\n y = x \/ (k + 1)\n z = y * k\n print y,\" \",z,\" \",(n - (z + y))\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long n, k, x, y, z;\n cin >> n >> k;\n x = n \/ 2;\n if ((k + 1) > x)\n cout << 0 << \" \" << 0 << \" \" << n << endl;\n else {\n y = x \/ (k + 1);\n z = y * k;\n cout << y << \" \" << z << \" \" << (n - (z + y)) << endl;\n }\n return 0;\n}","item":{"problem_id":"818A","pseudocode":"define the main function\n n, k, x, y, z = long long\n read n, k\n x = n \/ 2\n if (k + 1) > x\n print 0,\" \",0,\" \",n\n else\n y = x \/ (k + 1)\n z = y * k\n print y,\" \",z,\" \",(n - (z + y))\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["18 2"],["3 6 9"]],[["9 10"],["0 0 9"]],[["1000000000000 5"],["83333333333 416666666665 500000000002"]],[["1000000000000 499999999999"],["1 499999999999 500000000000"]],[["1 1"],["0 0 1"]],[["5 3"],["0 0 5"]],[["42 6"],["3 18 21"]],[["1000000000000 1000"],["499500499 499500499000 500000000501"]],[["999999999999 999999"],["499999 499998500001 500000999999"]],[["732577309725 132613"],["2762066 366285858458 366288689201"]],[["152326362626 15"],["4760198832 71402982480 76163181314"]],[["2 1"],["0 0 2"]],[["1000000000000 500000000000"],["0 0 1000000000000"]],[["100000000000 50000000011"],["0 0 100000000000"]],[["1000000000000 32416187567"],["15 486242813505 513757186480"]],[["1000000000000 7777777777"],["64 497777777728 502222222208"]],[["1000000000000 77777777777"],["6 466666666662 533333333332"]],[["100000000000 578485652"],["86 49749766072 50250233842"]],[["999999999999 10000000000"],["49 490000000000 509999999950"]],[["7 2"],["1 2 4"]],[["420506530901 752346673804"],["0 0 420506530901"]],[["960375521135 321688347872"],["1 321688347872 638687173262"]],[["1000000000000 1000000000000"],["0 0 1000000000000"]],[["99999999999 15253636363"],["3 45760909089 54239090907"]],[["19 2"],["3 6 10"]],[["999999999999 1000000000000"],["0 0 999999999999"]],[["1000000000000 5915587276"],["84 496909331184 503090668732"]],[["1000000000000 1000000006"],["499 499000002994 500999996507"]],[["549755813888 134217728"],["2047 274743689216 275012122625"]],[["99999999999 3333333"],["14999 49996661667 50003323333"]],[["9 1"],["2 2 5"]],[["1000000000000 250000000001"],["1 250000000001 749999999998"]],[["5 1"],["1 1 3"]],[["3107038133 596040207"],["2 1192080414 1914957717"]],[["1000000000000 73786977"],["6776 499980556152 500019437072"]],[["1000000000000 73786976"],["6776 499980549376 500019443848"]],[["1000000000000 25000000000"],["19 475000000000 524999999981"]],[["216929598879 768233755932"],["0 0 216929598879"]],[["1000000000000 250000000000"],["1 250000000000 749999999999"]],[["1000000000000 100000000001"],["4 400000000004 599999999992"]],[["100000000000 100000000001"],["0 0 100000000000"]],[["900000000000 100281800001"],["4 401127200004 498872799992"]],[["906028900004 109123020071"],["4 436492080284 469536819716"]],[["1000000000000 1"],["250000000000 250000000000 500000000000"]]]}} +{"instance_id":"pseudo_to_code_0.5k_182","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let q and b be long long\n let s be a char\n let num1 and num2 be long long = 0\n read q\n for long long i = 0 to q exclusive\n read n\n read s\n set num1 to s - 48\n if n is 2\n read s\n set num2 to s - 48\n is num1 >= num2\n print NO\n else\n print YES\n print 2\n print num1 and space and num2\n end of the block\n else\n print YES\n print 2\n print num1 and space\n for long long j = 1 to n excluded\n read s\n print s\n end of the block\n print new line\n set num2 to 0\n set num1 to 0\n end of the block\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long q, n;\n char s;\n long long num1, num2 = 0;\n cin >> q;\n for (long long i = 0; i < q; i++) {\n cin >> n;\n cin >> s;\n num1 = s - 48;\n if (n == 2) {\n cin >> s;\n num2 = s - 48;\n if (num1 >= num2)\n cout << \"NO\" << endl;\n else {\n cout << \"YES\" << endl;\n cout << 2 << endl;\n cout << num1 << \" \" << num2 << endl;\n }\n } else {\n cout << \"YES\" << endl;\n cout << 2 << endl;\n cout << num1 << \" \";\n for (long long j = 1; j < n; j++) {\n cin >> s;\n cout << s;\n }\n cout << endl;\n num2 = 0;\n num1 = 0;\n }\n }\n}","item":{"problem_id":"1107A","pseudocode":"define the main function\n let q and b be long long\n let s be a char\n let num1 and num2 be long long = 0\n read q\n for long long i = 0 to q exclusive\n read n\n read s\n set num1 to s - 48\n if n is 2\n read s\n set num2 to s - 48\n is num1 >= num2\n print NO\n else\n print YES\n print 2\n print num1 and space and num2\n end of the block\n else\n print YES\n print 2\n print num1 and space\n for long long j = 1 to n excluded\n read s\n print s\n end of the block\n print new line\n set num2 to 0\n set num1 to 0\n end of the block\n end of the block\nend of the block","testcases":[[["4","6","654321","4","1337","2","33","4","2122"],["YES","2","6 54321","YES","2","1 337","NO","YES","2","2 122"]],[["1","4","3333"],["YES","2","3 333"]],[["21","3","123","3","123","3","123","3","123","3","123","3","213","3","123","3","123","3","123","3","321","3","123","3","321","3","132","3","322","3","321","3","341","3","123","3","421","3","421","3","421","3","421"],["YES","2","1 23","YES","2","1 23","YES","2","1 23","YES","2","1 23","YES","2","1 23","YES","2","2 13","YES","2","1 23","YES","2","1 23","YES","2","1 23","YES","2","3 21","YES","2","1 23","YES","2","3 21","YES","2","1 32","YES","2","3 22","YES","2","3 21","YES","2","3 41","YES","2","1 23","YES","2","4 21","YES","2","4 21","YES","2","4 21","YES","2","4 21"]],[["1","3","333"],["YES","2","3 33"]],[["1","4","5234"],["YES","2","5 234"]],[["1","4","9999"],["YES","2","9 999"]],[["2","2","45","2","67"],["YES","2","4 5","YES","2","6 7"]],[["72","2","11","2","12","2","13","2","14","2","15","2","16","2","17","2","18","2","19","2","21","2","22","2","23","2","24","2","25","2","26","2","27","2","28","2","29","2","31","2","32","2","33","2","34","2","35","2","36","2","37","2","38","2","39","2","41","2","42","2","43","2","44","2","45","2","46","2","47","2","48","2","49","2","51","2","52","2","53","2","54","2","55","2","56","2","57","2","58","2","59","2","61","2","62","2","63","2","64","2","65","2","66","2","67","2","68","2","69","2","71","2","72","2","73","2","74","2","75","2","76","2","77","2","78","2","79","2","81","2","82","2","83","2","84","2","85","2","86","2","87","2","88","2","89"],["NO","YES","2","1 2","YES","2","1 3","YES","2","1 4","YES","2","1 5","YES","2","1 6","YES","2","1 7","YES","2","1 8","YES","2","1 9","NO","NO","YES","2","2 3","YES","2","2 4","YES","2","2 5","YES","2","2 6","YES","2","2 7","YES","2","2 8","YES","2","2 9","NO","NO","NO","YES","2","3 4","YES","2","3 5","YES","2","3 6","YES","2","3 7","YES","2","3 8","YES","2","3 9","NO","NO","NO","NO","YES","2","4 5","YES","2","4 6","YES","2","4 7","YES","2","4 8","YES","2","4 9","NO","NO","NO","NO","NO","YES","2","5 6","YES","2","5 7","YES","2","5 8","YES","2","5 9","NO","NO","NO","NO","NO","NO","YES","2","6 7","YES","2","6 8","YES","2","6 9","NO","NO","NO","NO","NO","NO","NO","YES","2","7 8","YES","2","7 9","NO","NO","NO","NO","NO","NO","NO","NO","YES","2","8 9"]],[["50","3","291","3","259","3","916","3","297","3","771","3","436","3","697","3","938","3","686","3","751","3","875","3","739","3","214","3","774","3","442","3","382","3","533","3","222","3","529","3","876","3","666","3","712","3","229","3","672","3","446","3","584","3","715","3","398","3","457","3","856","3","568","3","574","3","167","3","685","3","688","3","162","3","376","3","929","3","838","3","811","3","217","3","869","3","778","3","585","3","723","3","927","3","818","3","312","3","154","3","282"],["YES","2","2 91","YES","2","2 59","YES","2","9 16","YES","2","2 97","YES","2","7 71","YES","2","4 36","YES","2","6 97","YES","2","9 38","YES","2","6 86","YES","2","7 51","YES","2","8 75","YES","2","7 39","YES","2","2 14","YES","2","7 74","YES","2","4 42","YES","2","3 82","YES","2","5 33","YES","2","2 22","YES","2","5 29","YES","2","8 76","YES","2","6 66","YES","2","7 12","YES","2","2 29","YES","2","6 72","YES","2","4 46","YES","2","5 84","YES","2","7 15","YES","2","3 98","YES","2","4 57","YES","2","8 56","YES","2","5 68","YES","2","5 74","YES","2","1 67","YES","2","6 85","YES","2","6 88","YES","2","1 62","YES","2","3 76","YES","2","9 29","YES","2","8 38","YES","2","8 11","YES","2","2 17","YES","2","8 69","YES","2","7 78","YES","2","5 85","YES","2","7 23","YES","2","9 27","YES","2","8 18","YES","2","3 12","YES","2","1 54","YES","2","2 82"]],[["25","2","82","3","974","4","6797","5","47443","6","623449","7","9984868","8","91758564","9","193637617","10","6864783927","11","91715395994","12","458844671227","13","9992475186695","14","86926216332834","15","983867581873935","16","5349544157887648","17","14992391531125483","18","333817944727674728","19","5795456137848222379","20","39823756735682249657","21","695689748953529742158","22","4754898975627424529661","23","11755391689883277363286","24","862241334889132814749561","25","2778599994861659257172152","26","55939214449537676611886399"],["NO","YES","2","9 74","YES","2","6 797","YES","2","4 7443","YES","2","6 23449","YES","2","9 984868","YES","2","9 1758564","YES","2","1 93637617","YES","2","6 864783927","YES","2","9 1715395994","YES","2","4 58844671227","YES","2","9 992475186695","YES","2","8 6926216332834","YES","2","9 83867581873935","YES","2","5 349544157887648","YES","2","1 4992391531125483","YES","2","3 33817944727674728","YES","2","5 795456137848222379","YES","2","3 9823756735682249657","YES","2","6 95689748953529742158","YES","2","4 754898975627424529661","YES","2","1 1755391689883277363286","YES","2","8 62241334889132814749561","YES","2","2 778599994861659257172152","YES","2","5 5939214449537676611886399"]],[["1","300","951325167342511899748772763235486675437187562832396392791922316151565473875663341312453252658631194926772677944627881546241522716658129827235674715856795587777315234573798993817538559346453355547565852585289847578975896874948364345289542941942615842442343446925811616839298514177269535248554227563267"],["YES","2","9 51325167342511899748772763235486675437187562832396392791922316151565473875663341312453252658631194926772677944627881546241522716658129827235674715856795587777315234573798993817538559346453355547565852585289847578975896874948364345289542941942615842442343446925811616839298514177269535248554227563267"]]]}} +{"instance_id":"pseudo_to_code_0.5k_183","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n, c = long long with c = 0\n read n\n while decrement n\n p, q = long long with p = 0, q = 0\n read p, q\n if (q - p >= 2), increment c\n end of the block\n print c\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long n, c = 0;\n cin >> n;\n while (n--) {\n long long p = 0, q = 0;\n cin >> p >> q;\n if (q - p >= 2) c++;\n }\n cout << c << endl;\n return 0;\n}","item":{"problem_id":"467A","pseudocode":"define the main function\n n, c = long long with c = 0\n read n\n while decrement n\n p, q = long long with p = 0, q = 0\n read p, q\n if (q - p >= 2), increment c\n end of the block\n print c\n return to indicate successful execution\nend of the block","testcases":[[["3","1 1","2 2","3 3"],["0"]],[["3","1 10","0 10","10 10"],["2"]],[["2","36 67","61 69"],["2"]],[["3","21 71","10 88","43 62"],["3"]],[["3","1 2","2 3","3 4"],["0"]],[["10","0 10","0 20","0 30","0 40","0 50","0 60","0 70","0 80","0 90","0 100"],["10"]],[["13","14 16","30 31","45 46","19 20","15 17","66 67","75 76","95 97","29 30","37 38","0 2","36 37","8 9"],["4"]],[["19","66 67","97 98","89 91","67 69","67 68","18 20","72 74","28 30","91 92","27 28","75 77","17 18","74 75","28 30","16 18","90 92","9 11","22 24","52 54"],["12"]],[["15","55 57","95 97","57 59","34 36","50 52","96 98","39 40","13 15","13 14","74 76","47 48","56 58","24 25","11 13","67 68"],["10"]],[["17","68 69","47 48","30 31","52 54","41 43","33 35","38 40","56 58","45 46","92 93","73 74","61 63","65 66","37 39","67 68","77 78","28 30"],["8"]],[["14","64 66","43 44","10 12","76 77","11 12","25 27","87 88","62 64","39 41","58 60","10 11","28 29","57 58","12 14"],["7"]],[["38","74 76","52 54","78 80","48 49","40 41","64 65","28 30","6 8","49 51","68 70","44 45","57 59","24 25","46 48","49 51","4 6","63 64","76 78","57 59","18 20","63 64","71 73","88 90","21 22","89 90","65 66","89 91","96 98","42 44","1 1","74 76","72 74","39 40","75 76","29 30","48 49","87 89","27 28"],["22"]],[["100","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 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","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 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","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 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","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 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"],["0"]],[["26","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2","1 2"],["0"]],[["68","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2","0 2"],["68"]],[["7","0 1","1 5","2 4","3 5","4 6","5 6","6 8"],["5"]],[["1","0 0"],["0"]],[["1","100 100"],["0"]],[["44","0 8","1 11","2 19","3 5","4 29","5 45","6 6","7 40","8 19","9 22","10 18","11 26","12 46","13 13","14 27","15 48","16 25","17 20","18 29","19 27","20 45","21 39","22 29","23 39","24 42","25 37","26 52","27 36","28 43","29 35","30 38","31 70","32 47","33 38","34 61","35 71","36 51","37 71","38 59","39 77","40 70","41 80","42 77","43 73"],["42"]],[["3","1 3","2 7","8 9"],["2"]],[["53","0 1","1 2","2 3","3 4","4 5","5 6","6 7","7 8","8 9","9 10","10 11","11 12","12 13","13 14","14 15","15 16","16 17","17 18","18 19","19 20","20 21","21 22","22 23","23 24","24 25","25 26","26 27","27 28","28 29","29 30","30 31","31 32","32 33","33 34","34 35","35 36","36 37","37 38","38 39","39 40","40 41","41 42","42 43","43 44","44 45","45 46","46 47","47 48","48 49","49 50","50 51","51 52","52 53"],["0"]],[["55","0 0","1 1","2 2","3 3","4 4","5 5","6 6","7 7","8 8","9 9","10 10","11 11","12 12","13 13","14 14","15 15","16 16","17 17","18 18","19 19","20 20","21 21","22 22","23 23","24 24","25 25","26 26","27 27","28 28","29 29","30 30","31 31","32 32","33 33","34 34","35 35","36 36","37 37","38 38","39 39","40 40","41 41","42 42","43 43","44 44","45 45","46 46","47 47","48 48","49 49","50 50","51 51","52 52","53 53","54 54"],["0"]],[["51","55 55","55 55","55 55","55 55","55 55","55 55","55 55","55 55","55 55","55 62","55 55","55 55","55 55","55 55","55 55","55 55","55 55","55 55","55 55","55 55","55 55","55 73","55 55","55 55","55 55","55 55","55 55","55 55","55 55","55 55","55 55","55 82","55 68","55 70","55 63","55 55","55 55","55 55","55 75","55 75","55 55","55 55","55 55","55 55","55 55","55 55","55 73","55 55","55 82","55 99","55 60"],["12"]],[["14","1 1","1 1","1 55","1 16","1 1","1 1","1 55","1 62","1 53","1 26","1 1","1 36","1 2","1 3"],["8"]]]}} +{"instance_id":"pseudo_to_code_0.5k_184","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create long longs n, m and a\n read n, m and a\n long long stones = (n \/ a) * (m \/ a)\n if n % a != 0 add m \/ a to stones\n if m % a != 0 add n \/ a to stones\n if m % a != 0 && n % a != 0 add 1 to stones\n print stones and a new line\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long n, m, a;\n cin >> n >> m >> a;\n long long stones = (n \/ a) * (m \/ a);\n if (n % a != 0) { stones += m \/ a; }\n if (m % a != 0) { stones += n \/ a; }\n if (m % a != 0 && n % a != 0) { ++stones; }\n cout << stones << endl;\n return 0;\n}","item":{"problem_id":"1A","pseudocode":"define the main function\n create long longs n, m and a\n read n, m and a\n long long stones = (n \/ a) * (m \/ a)\n if n % a != 0 add m \/ a to stones\n if m % a != 0 add n \/ a to stones\n if m % a != 0 && n % a != 0 add 1 to stones\n print stones and a new line\n return to indicate successful execution\nend of the block","testcases":[[["6 6 4"],["4"]],[["1 1 1"],["1"]],[["2 1 1"],["2"]],[["1 2 1"],["2"]],[["2 2 1"],["4"]],[["2 1 2"],["1"]],[["1 1 3"],["1"]],[["2 3 4"],["1"]],[["1000000000 1000000000 1"],["1000000000000000000"]],[["12 13 4"],["12"]],[["222 332 5"],["3015"]],[["1000 1000 10"],["10000"]],[["1001 1000 10"],["10100"]],[["100 10001 1000000000"],["1"]],[["1000000000 1000000000 1000000000"],["1"]],[["1000000000 1000000000 999999999"],["4"]],[["1000000000 1000000000 192"],["27126743055556"]],[["1000000000 987654321 1"],["987654321000000000"]],[["456784567 1000000000 51"],["175618850864484"]],[["39916800 134217728 40320"],["3295710"]]]}} +{"instance_id":"pseudo_to_code_0.5k_185","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n i, j, n, max, count = ints with count = 1\n let a be a long long int array of length 100005\n read n\n set max to 1\n for i = 0 to n exclusive\n read a at i\n if a[i-1] < a at i and i isn't 0\n increment count\n if max < count the set max to count\n else\n set count to 1\n end of the block\n print max\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int i, j, n, max, count = 1;\n long long int a[100005];\n cin >> n;\n max = 1;\n for (i = 0; i < n; i++) {\n cin >> a[i];\n if (a[i - 1] < a[i] && i != 0) {\n count++;\n if (max < count) max = count;\n } else\n count = 1;\n }\n cout << max << endl;\n return 0;\n}","item":{"problem_id":"702A","pseudocode":"define the main function\n i, j, n, max, count = ints with count = 1\n let a be a long long int array of length 100005\n read n\n set max to 1\n for i = 0 to n exclusive\n read a at i\n if a[i-1] < a at i and i isn't 0\n increment count\n if max < count the set max to count\n else\n set count to 1\n end of the block\n print max\n return to indicate successful execution\nend of the block","testcases":[[["5","1 7 2 11 15"],["3"]],[["6","100 100 100 100 100 100"],["1"]],[["3","1 2 3"],["3"]],[["1","1000000000"],["1"]],[["10","802030518 598196518 640274071 983359971 71550121 96204862 799843967 446173607 796619138 402690754"],["3"]],[["2","2 1"],["1"]],[["5","1 2 3 3 4"],["3"]],[["4","1 2 2 3"],["2"]],[["3","2 1 1"],["1"]],[["3","1 2 1"],["2"]],[["1","1"],["1"]],[["2","1 2"],["2"]],[["3","1 1 2"],["2"]],[["11","1 2 3 1 2 3 2 1 2 3 4"],["4"]],[["9","1 2 3 4 5 6 7 8 9"],["9"]],[["9","1 1 1 1 1 1 1 1 1"],["1"]],[["3","3 2 1"],["1"]],[["7","1 2 3 4 5 6 7"],["7"]],[["1","1234394"],["1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_186","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let t be a integer\n read t\n while t is true\n let n be a integer\n read n\n the double value of k = 3.0\n the double value of ans = 0.0\n while the condition is true\n ans is equal to ((k - 2.0) * 180.0) \/ k\n if n equals ans\n print YES and newline\n stop\n else if ans is greater than n\n print NO and newline\n stop\n end of the block\n increment k by 1\n end of the block\n decrement t by 1\n end of the block\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int t;\n cin >> t;\n while (t) {\n int n;\n cin >> n;\n double k = 3.0;\n double ans = 0.0;\n while (1) {\n ans = ((k - 2.0) * 180.0) \/ k;\n if (n == ans) {\n cout << \"YES\" << endl;\n break;\n } else if (ans > n) {\n cout << \"NO\" << endl;\n break;\n }\n k++;\n }\n t--;\n }\n}","item":{"problem_id":"270A","pseudocode":"define the main function\n let t be a integer\n read t\n while t is true\n let n be a integer\n read n\n the double value of k = 3.0\n the double value of ans = 0.0\n while the condition is true\n ans is equal to ((k - 2.0) * 180.0) \/ k\n if n equals ans\n print YES and newline\n stop\n else if ans is greater than n\n print NO and newline\n stop\n end of the block\n increment k by 1\n end of the block\n decrement t by 1\n end of the block\nend of the block","testcases":[[["3","30","60","90"],["NO","YES","YES"]],[["6","1","2","3","170","179","25"],["NO","NO","NO","YES","YES","NO"]],[["10","152","9","20","12","90","3","173","44","96","90"],["NO","NO","NO","NO","YES","NO","NO","NO","NO","YES"]],[["20","135","71","163","36","34","20","15","172","110","101","39","175","165","42","16","170","45","156","9","159"],["YES","NO","NO","NO","NO","NO","NO","YES","NO","NO","NO","YES","YES","NO","NO","YES","NO","YES","NO","NO"]],[["20","18","59","45","10","44","30","102","25","11","159","97","52","12","145","72","18","160","5","154","94"],["NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","YES","NO","NO","NO"]],[["20","108","31","15","114","64","45","2","5","78","132","49","39","135","130","143","146","54","133","4","50"],["YES","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","YES","NO","NO","NO","NO","NO","NO","NO"]],[["20","60","1","5","18","5","15","3","15","30","3","3","10","90","90","1","9","2","6","15","2"],["YES","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","YES","YES","NO","NO","NO","NO","NO","NO"]],[["20","12","85","90","122","14","42","165","5","18","45","20","104","179","2","10","156","34","90","12","36"],["NO","NO","YES","NO","NO","NO","YES","NO","NO","NO","NO","NO","YES","NO","NO","YES","NO","YES","NO","NO"]],[["15","80","45","4","10","36","93","60","1","51","15","18","174","18","3","45"],["NO","NO","NO","NO","NO","NO","YES","NO","NO","NO","NO","YES","NO","NO","NO"]]]}} +{"instance_id":"pseudo_to_code_0.5k_187","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nin function fastpow with arguments of long long base and long long exp that returns a long long\n res = long long = 1\n while exp > 0\n if exp is odd, then res = (res * base) modulo 1000000009\n base = (base * base) % 1000000009\n exp = exp \/ 2\n end of the block\n return res modulo 1000000009\nend of the block\nin function ask with argument of long long a that returns a long long\n print 1 a\n x = long long\n read x\n return x\nend of the block\ndefine the main function\n testcases = long long\n read testcases\n while looping decrease testcases by 1\n a, b, k = long long\n read a, b, k\n if k is even\n print (k \/ 2) * (a - b)\n else\n print ((k - 1) \/ 2) * (a - b) + a\n end of the block\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"long long fastpow(long long base, long long exp) {\n long long res = 1;\n while (exp > 0) {\n if (exp % 2 == 1) res = (res * base) % 1000000009;\n base = (base * base) % 1000000009;\n exp \/= 2;\n }\n return res % 1000000009;\n}\nlong long ask(long long a) {\n cout << 1 << \" \" << a << endl;\n long long x;\n cin >> x;\n return x;\n}\nint main() {\n long long testcases;\n cin >> testcases;\n while (testcases--) {\n long long a, b, k;\n cin >> a >> b >> k;\n if (k % 2 == 0) {\n cout << (k \/ 2) * (a - b) << endl;\n } else {\n cout << ((k - 1) \/ 2) * (a - b) + a << endl;\n }\n }\n return 0;\n}","item":{"problem_id":"1077A","pseudocode":"in function fastpow with arguments of long long base and long long exp that returns a long long\n res = long long = 1\n while exp > 0\n if exp is odd, then res = (res * base) modulo 1000000009\n base = (base * base) % 1000000009\n exp = exp \/ 2\n end of the block\n return res modulo 1000000009\nend of the block\nin function ask with argument of long long a that returns a long long\n print 1 a\n x = long long\n read x\n return x\nend of the block\ndefine the main function\n testcases = long long\n read testcases\n while looping decrease testcases by 1\n a, b, k = long long\n read a, b, k\n if k is even\n print (k \/ 2) * (a - b)\n else\n print ((k - 1) \/ 2) * (a - b) + a\n end of the block\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["6","5 2 3","100 1 4","1 10 5","1000000000 1 6","1 1 1000000000","1 1 999999999"],["8","198","-17","2999999997","0","1"]],[["1","19280817 1 1"],["19280817"]],[["1","598 56 799"],["216856"]],[["1","599 56 799"],["217256"]],[["16","602436426 877914575 158260522","623690081 861648772 24979445","262703497 476190629 433933447","628894325 971407775 211047202","450968417 822804784 731963982","161735902 982631932 430302156","707723857 923078537 880895728","802329211 910286918 189330739","317063340 303238506 404539679","125660016 773361868 492686568","462224593 839296263 650287940","191890310 384836991 492601449","404011431 782177068 576823355","160449218 954291757 818008580","164163676 840594328 155374934","501899080 138996221 797829355"],["-21798657830166889","-2972037274383821","-46319603170004939","-36143252634933450","-136085413920866697","-176616665780420340","-94852508808403520","-10219855367219672","2796347264445066","-159557001274561968","-122602579758329900","-47522907031806734","-109067385146931818","-324685004035492310","-52550183955038484","144767277282260623"]],[["70","1 1 1","1 1 2","1 1 3","1 1 4","1 1 5","1 1 6","1 1 7","1 1 8","1 1 9","1 1 10","1 2 1","1 2 2","1 2 3","1 2 4","1 2 5","1 2 6","1 2 7","1 2 8","1 2 9","1 2 10","1 3 1","1 3 2","1 3 3","1 3 4","1 3 5","1 3 6","1 3 7","1 3 8","1 3 9","1 3 10","1 4 1","1 4 2","1 4 3","1 4 4","1 4 5","1 4 6","1 4 7","1 4 8","1 4 9","1 4 10","1 5 1","1 5 2","1 5 3","1 5 4","1 5 5","1 5 6","1 5 7","1 5 8","1 5 9","1 5 10","1 6 1","1 6 2","1 6 3","1 6 4","1 6 5","1 6 6","1 6 7","1 6 8","1 6 9","1 6 10","1 7 1","1 7 2","1 7 3","1 7 4","1 7 5","1 7 6","1 7 7","1 7 8","1 7 9","1 7 10"],["1","0","1","0","1","0","1","0","1","0","1","-1","0","-2","-1","-3","-2","-4","-3","-5","1","-2","-1","-4","-3","-6","-5","-8","-7","-10","1","-3","-2","-6","-5","-9","-8","-12","-11","-15","1","-4","-3","-8","-7","-12","-11","-16","-15","-20","1","-5","-4","-10","-9","-15","-14","-20","-19","-25","1","-6","-5","-12","-11","-18","-17","-24","-23","-30"]],[["30","1 1 1000000000","1 1 999999999","1 1 999999998","1 1 999999997","1 1 999999996","1 1 999999995","1 1 999999994","1 1 999999993","1 1 999999992","1 1 999999991","1 2 1000000000","1 2 999999999","1 2 999999998","1 2 999999997","1 2 999999996","1 2 999999995","1 2 999999994","1 2 999999993","1 2 999999992","1 2 999999991","1 3 1000000000","1 3 999999999","1 3 999999998","1 3 999999997","1 3 999999996","1 3 999999995","1 3 999999994","1 3 999999993","1 3 999999992","1 3 999999991"],["0","1","0","1","0","1","0","1","0","1","-500000000","-499999998","-499999999","-499999997","-499999998","-499999996","-499999997","-499999995","-499999996","-499999994","-1000000000","-999999997","-999999998","-999999995","-999999996","-999999993","-999999994","-999999991","-999999992","-999999989"]],[["30","1 1000000000 1","1 1000000000 2","1 1000000000 3","1 1000000000 4","1 1000000000 5","1 1000000000 6","1 1000000000 7","1 1000000000 8","1 1000000000 9","1 1000000000 10","1 999999999 1","1 999999999 2","1 999999999 3","1 999999999 4","1 999999999 5","1 999999999 6","1 999999999 7","1 999999999 8","1 999999999 9","1 999999999 10","1 999999998 1","1 999999998 2","1 999999998 3","1 999999998 4","1 999999998 5","1 999999998 6","1 999999998 7","1 999999998 8","1 999999998 9","1 999999998 10"],["1","-999999999","-999999998","-1999999998","-1999999997","-2999999997","-2999999996","-3999999996","-3999999995","-4999999995","1","-999999998","-999999997","-1999999996","-1999999995","-2999999994","-2999999993","-3999999992","-3999999991","-4999999990","1","-999999997","-999999996","-1999999994","-1999999993","-2999999991","-2999999990","-3999999988","-3999999987","-4999999985"]],[["30","1000000000 1 1","1000000000 1 2","1000000000 1 3","1000000000 1 4","1000000000 1 5","1000000000 1 6","1000000000 1 7","1000000000 1 8","1000000000 1 9","1000000000 1 10","1000000000 2 1","1000000000 2 2","1000000000 2 3","1000000000 2 4","1000000000 2 5","1000000000 2 6","1000000000 2 7","1000000000 2 8","1000000000 2 9","1000000000 2 10","1000000000 3 1","1000000000 3 2","1000000000 3 3","1000000000 3 4","1000000000 3 5","1000000000 3 6","1000000000 3 7","1000000000 3 8","1000000000 3 9","1000000000 3 10"],["1000000000","999999999","1999999999","1999999998","2999999998","2999999997","3999999997","3999999996","4999999996","4999999995","1000000000","999999998","1999999998","1999999996","2999999996","2999999994","3999999994","3999999992","4999999992","4999999990","1000000000","999999997","1999999997","1999999994","2999999994","2999999991","3999999991","3999999988","4999999988","4999999985"]],[["20","1000000000 1 1000000000","1000000000 1 999999999","1000000000 1 999999998","1000000000 1 999999997","1000000000 1 999999996","1000000000 1 999999995","1000000000 1 999999994","1000000000 1 999999993","1000000000 1 999999992","1000000000 1 999999991","1000000000 2 1000000000","1000000000 2 999999999","1000000000 2 999999998","1000000000 2 999999997","1000000000 2 999999996","1000000000 2 999999995","1000000000 2 999999994","1000000000 2 999999993","1000000000 2 999999992","1000000000 2 999999991"],["499999999500000000","499999999500000001","499999998500000001","499999998500000002","499999997500000002","499999997500000003","499999996500000003","499999996500000004","499999995500000004","499999995500000005","499999999000000000","499999999000000002","499999998000000002","499999998000000004","499999997000000004","499999997000000006","499999996000000006","499999996000000008","499999995000000008","499999995000000010"]],[["20","1000000000 1000000000 1","1000000000 1000000000 2","1000000000 1000000000 3","1000000000 1000000000 4","1000000000 1000000000 5","1000000000 1000000000 6","1000000000 1000000000 7","1000000000 1000000000 8","1000000000 1000000000 9","1000000000 1000000000 10","1000000000 999999999 1","1000000000 999999999 2","1000000000 999999999 3","1000000000 999999999 4","1000000000 999999999 5","1000000000 999999999 6","1000000000 999999999 7","1000000000 999999999 8","1000000000 999999999 9","1000000000 999999999 10"],["1000000000","0","1000000000","0","1000000000","0","1000000000","0","1000000000","0","1000000000","1","1000000001","2","1000000002","3","1000000003","4","1000000004","5"]]]}} +{"instance_id":"pseudo_to_code_0.5k_188","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n l, r = long long\n read l, r\n if r - l + 1 < 3\n print -1\n return to indicate successful execution\n end of the block\n if l modulo 2 is 0\n print l,' ',l + 1,' ',l + 2\n return to indicate successful execution\n end of the block\n if r - l + 1 > 3\n print l + 1,' ',l + 2,' ',l + 3\n return to indicate successful execution\n end of the block\n print -1\nend of the block\n\n[CODE]:","reference_output":"int main() {\n long long l, r;\n cin >> l >> r;\n if (r - l + 1 < 3) {\n cout << -1 << endl;\n return 0;\n }\n if (l % 2 == 0) {\n cout << l << ' ' << l + 1 << ' ' << l + 2 << endl;\n return 0;\n }\n if (r - l + 1 > 3) {\n cout << l + 1 << ' ' << l + 2 << ' ' << l + 3 << endl;\n return 0;\n }\n cout << -1 << endl;\n}","item":{"problem_id":"483A","pseudocode":"define the main function\n l, r = long long\n read l, r\n if r - l + 1 < 3\n print -1\n return to indicate successful execution\n end of the block\n if l modulo 2 is 0\n print l,' ',l + 1,' ',l + 2\n return to indicate successful execution\n end of the block\n if r - l + 1 > 3\n print l + 1,' ',l + 2,' ',l + 3\n return to indicate successful execution\n end of the block\n print -1\nend of the block","testcases":[[["2 4"],["2 3 4"]],[["10 11"],["-1"]],[["900000000000000009 900000000000000029"],["900000000000000010 900000000000000011 900000000000000012"]],[["640097987171091791 640097987171091835"],["640097987171091792 640097987171091793 640097987171091794"]],[["19534350415104721 19534350415104725"],["19534350415104722 19534350415104723 19534350415104724"]],[["933700505788726243 933700505788726280"],["933700505788726244 933700505788726245 933700505788726246"]],[["1 3"],["-1"]],[["1 4"],["2 3 4"]],[["1 1"],["-1"]],[["266540997167959130 266540997167959164"],["266540997167959130 266540997167959131 266540997167959132"]],[["267367244641009850 267367244641009899"],["267367244641009850 267367244641009851 267367244641009852"]],[["268193483524125978 268193483524125993"],["268193483524125978 268193483524125979 268193483524125980"]],[["269019726702209402 269019726702209432"],["269019726702209402 269019726702209403 269019726702209404"]],[["269845965585325530 269845965585325576"],["269845965585325530 269845965585325531 269845965585325532"]],[["270672213058376250 270672213058376260"],["270672213058376250 270672213058376251 270672213058376252"]],[["271498451941492378 271498451941492378"],["-1"]],[["272324690824608506 272324690824608523"],["272324690824608506 272324690824608507 272324690824608508"]],[["273150934002691930 273150934002691962"],["273150934002691930 273150934002691931 273150934002691932"]],[["996517375802030516 996517375802030524"],["996517375802030516 996517375802030517 996517375802030518"]],[["997343614685146644 997343614685146694"],["997343614685146644 997343614685146645 997343614685146646"]],[["998169857863230068 998169857863230083"],["998169857863230068 998169857863230069 998169857863230070"]],[["998996101041313492 998996101041313522"],["998996101041313492 998996101041313493 998996101041313494"]],[["999822344219396916 999822344219396961"],["999822344219396916 999822344219396917 999822344219396918"]],[["648583102513043 648583102513053"],["648583102513044 648583102513045 648583102513046"]],[["266540997167959130 266540997167959131"],["-1"]],[["267367244641009850 267367244641009850"],["-1"]],[["268193483524125978 268193483524125979"],["-1"]],[["269019726702209402 269019726702209402"],["-1"]],[["269845965585325530 269845965585325530"],["-1"]],[["270672213058376250 270672213058376254"],["270672213058376250 270672213058376251 270672213058376252"]],[["271498451941492378 271498451941492379"],["-1"]],[["272324690824608506 272324690824608508"],["272324690824608506 272324690824608507 272324690824608508"]],[["273150934002691930 273150934002691931"],["-1"]],[["996517375802030516 996517375802030518"],["996517375802030516 996517375802030517 996517375802030518"]],[["997343614685146644 997343614685146644"],["-1"]],[["2147483647 2147483649"],["-1"]],[["3 5"],["-1"]],[["1 7"],["2 3 4"]],[["9 12"],["10 11 12"]],[["4 4"],["-1"]],[["11 13"],["-1"]],[["2 2"],["-1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_189","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let s, s1 be strings\n let n,k be integers\n read n,k\n if (k is greater than n or (k is equal to 1 and n is greater than 1)) , and print -1 and endline , return 0\n if (k is equal to 1) print a and endline, return 0\n for( i=1 to k - 2 inclusive), s is equal to s + b + i\n for( i=1 to n- k +2 inclusive), s1 = s1 + (if i modulus 2 ) ? a else b\n print s1 and s and newline\nend of the block\n\n[CODE]:","reference_output":"int main() {\n string s, s1;\n int n, k;\n cin >> n >> k;\n if (k > n || (k == 1 && n > 1)) return cout << \"-1\" << endl, 0;\n if (k == 1) return cout << \"a\" << endl, 0;\n for (int i = 1; i <= k - 2; i++) s += 'b' + i;\n for (int i = 1; i <= n - k + 2; i++) s1 += i % 2 ? 'a' : 'b';\n cout << s1 << s << endl;\n}","item":{"problem_id":"288A","pseudocode":"define the main function\n let s, s1 be strings\n let n,k be integers\n read n,k\n if (k is greater than n or (k is equal to 1 and n is greater than 1)) , and print -1 and endline , return 0\n if (k is equal to 1) print a and endline, return 0\n for( i=1 to k - 2 inclusive), s is equal to s + b + i\n for( i=1 to n- k +2 inclusive), s1 = s1 + (if i modulus 2 ) ? a else b\n print s1 and s and newline\nend of the block","testcases":[[["7 4"],["ababacd"]],[["4 7"],["-1"]],[["10 5"],["abababacde"]],[["47 2"],["abababababababababababababababababababababababa"]],[["10 7"],["ababacdefg"]],[["20 7"],["abababababababacdefg"]],[["26 26"],["abcdefghijklmnopqrstuvwxyz"]],[["47 1"],["-1"]],[["128 26"],["ababababababababababababababababababababababababababababababababababababababababababababababababababababcdefghijklmnopqrstuvwxyz"]],[["4585 1"],["-1"]],[["1000000 1"],["-1"]],[["6795 1"],["-1"]],[["12 17"],["-1"]],[["1 1"],["a"]],[["2 2"],["ab"]],[["1 2"],["-1"]],[["1 26"],["-1"]],[["26 2"],["ababababababababababababab"]],[["123 21"],["ababababababababababababababababababababababababababababababababababababababababababababababababababababcdefghijklmnopqrstu"]],[["3 3"],["abc"]]]}} +{"instance_id":"pseudo_to_code_0.5k_190","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create int n, i and arrays p and s of length 100100\n read n\n for i=2 to n inclusive, read p[i]\n for i=1 to n inclusive, read s[i]\n for i=2 to n inclusive\n if s[i] = -1, continue the loop\n s[p[i]] = -1\n set s[p[i]] = s[i]\n else\n s[p[i]] = min of s[p[i]] and s[i]\n end of the block\n for i=2 to n inclusive\n if s[i] equal to -1, continue the loop\n if s[p[i]] greater than s[i]\n print -1\n return to indicate successful execution\n end of the block\n end of the block\n set ans to s[1]\n for i=2 to n inclusive\n if s[i] equal to -1, continue the loop\n assign ans + s[i] - s[p[i]] to ans\n end of the block\n print ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, p[100100], s[100100], i;\n cin >> n;\n for (i = 2; i <= n; i++) cin >> p[i];\n for (i = 1; i <= n; i++) cin >> s[i];\n for (i = 2; i <= n; i++) {\n if (s[i] == -1) continue;\n if (s[p[i]] == -1)\n s[p[i]] = s[i];\n else\n s[p[i]] = min(s[p[i]], s[i]);\n }\n for (i = 2; i <= n; i++) {\n if (s[i] == -1) continue;\n if (s[p[i]] > s[i]) {\n cout << -1 << endl;\n return 0;\n }\n }\n long long ans = s[1];\n for (i = 2; i <= n; i++) {\n if (s[i] == -1) continue;\n ans += (s[i] - s[p[i]]);\n }\n cout << ans << endl;\n return 0;\n}","item":{"problem_id":"1098A","pseudocode":"define the main function\n create int n, i and arrays p and s of length 100100\n read n\n for i=2 to n inclusive, read p[i]\n for i=1 to n inclusive, read s[i]\n for i=2 to n inclusive\n if s[i] = -1, continue the loop\n s[p[i]] = -1\n set s[p[i]] = s[i]\n else\n s[p[i]] = min of s[p[i]] and s[i]\n end of the block\n for i=2 to n inclusive\n if s[i] equal to -1, continue the loop\n if s[p[i]] greater than s[i]\n print -1\n return to indicate successful execution\n end of the block\n end of the block\n set ans to s[1]\n for i=2 to n inclusive\n if s[i] equal to -1, continue the loop\n assign ans + s[i] - s[p[i]] to ans\n end of the block\n print ans\n return to indicate successful execution\nend of the block","testcases":[[["5","1 1 1 1","1 -1 -1 -1 -1"],["1"]],[["5","1 2 3 1","1 -1 2 -1 -1"],["2"]],[["3","1 2","2 -1 1"],["-1"]],[["2","1","0 -1"],["0"]],[["2","1","1 -1"],["1"]],[["5","1 2 2 3","1 -1 2 3 -1"],["3"]],[["5","1 2 3 4","5 -1 5 -1 7"],["7"]],[["10","1 1 1 1 2 3 4 5 1","3 -1 -1 -1 -1 3 3 3 3 -1"],["3"]],[["10","1 1 2 4 4 5 6 3 3","0 -1 -1 0 -1 -1 1 2 3 4"],["7"]],[["10","1 2 3 4 4 3 3 8 8","1 -1 1 -1 1 1 -1 -1 2 2"],["2"]],[["25","1 2 1 4 4 4 1 2 8 5 1 8 1 6 9 6 10 10 7 10 8 17 14 6","846 -1 941 -1 1126 1803 988 -1 1352 1235 -1 -1 864 -1 -1 -1 -1 -1 -1 -1 -1 1508 1802 1713 -1"],["-1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_191","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n a = array of integers of length 110\n let n be a integer\n read n\n let A , B be integers with A = 0, B = 0\n for i = 0 to n exclusive\n read a[i]\n if a[i] is greater than 0\n increment A by a[i]\n else do the following\n increment B by a[i]\n end of the block\n print A - B and newline\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int a[110];\n int n;\n cin >> n;\n int A = 0, B = 0;\n for (int i = 0; i < n; i++) {\n cin >> a[i];\n if (a[i] > 0)\n A += a[i];\n else\n B += a[i];\n }\n cout << A - B << endl;\n return 0;\n}","item":{"problem_id":"946A","pseudocode":"define the main function\n a = array of integers of length 110\n let n be a integer\n read n\n let A , B be integers with A = 0, B = 0\n for i = 0 to n exclusive\n read a[i]\n if a[i] is greater than 0\n increment A by a[i]\n else do the following\n increment B by a[i]\n end of the block\n print A - B and newline\n return to indicate successful execution\nend of the block","testcases":[[["3","1 -2 0"],["3"]],[["6","16 23 16 15 42 8"],["120"]],[["1","-1"],["1"]],[["100","-100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100"],["10000"]],[["2","-1 5"],["6"]],[["3","-2 0 1"],["3"]],[["12","-1 -2 -3 4 4 -6 -6 56 3 3 -3 3"],["94"]],[["4","1 -1 1 -1"],["4"]],[["4","100 -100 100 -100"],["400"]],[["3","-2 -5 10"],["17"]],[["5","1 -2 3 -4 5"],["15"]],[["3","-100 100 -100"],["300"]],[["6","1 -1 1 -1 1 -1"],["6"]],[["6","2 -2 2 -2 2 -2"],["12"]],[["9","12 93 -2 0 0 0 3 -3 -9"],["122"]],[["6","-1 2 4 -5 -3 55"],["70"]],[["6","-12 8 68 -53 1 -15"],["157"]],[["2","-2 1"],["3"]],[["3","100 -100 100"],["300"]],[["5","100 100 -1 -100 2"],["303"]],[["6","-5 -4 -3 -2 -1 0"],["15"]],[["6","4 4 4 -3 -3 2"],["20"]],[["2","-1 2"],["3"]],[["1","100"],["100"]],[["5","-1 -2 3 1 2"],["9"]],[["5","100 -100 100 -100 100"],["500"]],[["5","1 -1 1 -1 1"],["5"]],[["4","0 0 0 -1"],["1"]],[["5","100 -100 -1 2 100"],["303"]],[["2","75 0"],["75"]],[["4","55 56 -59 -58"],["228"]],[["2","9 71"],["80"]],[["2","9 70"],["79"]],[["2","9 69"],["78"]],[["2","100 -100"],["200"]],[["4","-9 4 -9 5"],["27"]],[["42","91 -27 -79 -56 80 -93 -23 10 80 94 61 -89 -64 81 34 99 31 -32 -69 92 79 -9 73 66 -8 64 99 99 58 -19 -40 21 1 -33 93 -23 -62 27 55 41 57 36"],["2348"]],[["7","-1 2 2 2 -1 2 -1"],["11"]],[["6","-12 8 17 -69 7 -88"],["201"]],[["3","1 -2 5"],["8"]],[["6","-2 3 -4 5 6 -1"],["21"]],[["2","-5 1"],["6"]],[["4","2 2 -2 4"],["10"]],[["68","21 47 -75 -25 64 83 83 -21 89 24 43 44 -35 34 -42 92 -96 -52 -66 64 14 -87 25 -61 -78 83 -96 -18 95 83 -93 -28 75 49 87 65 -93 -69 -2 95 -24 -36 -61 -71 88 -53 -93 -51 -81 -65 -53 -46 -56 6 65 58 19 100 57 61 -53 44 -58 48 -8 80 -88 72"],["3991"]],[["5","5 5 -10 -1 1"],["22"]],[["3","-1 2 3"],["6"]],[["76","57 -38 -48 -81 93 -32 96 55 -44 2 38 -46 42 64 71 -73 95 31 -39 -62 -1 75 -17 57 28 52 12 -11 82 -84 59 -86 73 -97 34 97 -57 -85 -6 39 -5 -54 95 24 -44 35 -18 9 91 7 -22 -61 -80 54 -40 74 -90 15 -97 66 -52 -49 -24 65 21 -93 -29 -24 -4 -1 76 -93 7 -55 -53 1"],["3787"]],[["5","-1 -2 1 2 3"],["9"]],[["4","2 2 -2 -2"],["8"]],[["6","100 -100 100 -100 100 -100"],["600"]],[["100","-59 -33 34 0 69 24 -22 58 62 -36 5 45 -19 -73 61 -9 95 42 -73 -64 91 -96 2 53 -8 82 -79 16 18 -5 -53 26 71 38 -31 12 -33 -1 -65 -6 3 -89 22 33 -27 -36 41 11 -47 -32 47 -56 -38 57 -63 -41 23 41 29 78 16 -65 90 -58 -12 6 -60 42 -36 -52 -54 -95 -10 29 70 50 -94 1 93 48 -71 -77 -16 54 56 -60 66 76 31 8 44 -61 -74 23 37 38 18 -18 29 41"],["4362"]],[["2","-1 1"],["2"]],[["3","1 -2 100"],["103"]],[["5","1 -2 3 1 2"],["9"]],[["10","100 -10 -100 10 10 10 10 10 10 10"],["280"]],[["4","2 0 -2 4"],["8"]],[["4","3 -3 1 -1"],["8"]],[["3","1 -1 1"],["3"]],[["4","2 5 -2 4"],["13"]],[["2","-2 2"],["4"]],[["3","1 -2 1"],["4"]],[["5","-1 -2 1 1 -1"],["6"]],[["4","-2 0 2 4"],["8"]],[["8","-42 7 87 -16 -5 65 -88 1"],["311"]],[["3","1 -3 4"],["8"]],[["1","1"],["1"]],[["2","0 1"],["1"]],[["3","-1 2 -1"],["4"]],[["18","-21 12 65 66 -24 62 82 35 -45 -47 28 37 5 -32 22 -14 -69 -95"],["761"]],[["4","-1 1 -1 1"],["4"]],[["5","-1 2 1 1 1"],["6"]],[["3","1 1 1"],["3"]]]}} +{"instance_id":"pseudo_to_code_0.5k_192","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nmaxn = const integer with maxn = 1e5 + 5\ndefine the main function\n n = integer\n s = string array of size 105\n read n\n for i = 0 to n exclusive\n s[i] = \" \"\n read s[i]\n end of the block\n ans = integer with ans = 0\n for i = 0 to 25\n for j = 0 to 25\n x = character with x = a + i\n y = character with y = a + j\n temp = integer with temp = 0\n for k = 0 to n exclusive\n temp1 = integer with temp1 = 0\n flag = integer with flag = 1\n for l = 0 to s[k].size() exclusive\n if (s[k][l] is x or s[k][l] is y)\n increment temp1\n else\n flag = 0\n break loop\n end of the block\n end of the block\n if (flag), temp = temp + temp1\n end of the block\n ans = max of ans and temp\n end of the block\n end of the block\n print ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"const int maxn = 1e5 + 5;\nint main() {\n int n;\n string s[105];\n cin >> n;\n for (int i = 0; i < n; ++i) {\n s[i] = \" \";\n cin >> s[i];\n }\n int ans = 0;\n for (int i = 0; i <= 26; ++i) {\n for (int j = 0; j <= 26; ++j) {\n char x = 'a' + i;\n char y = 'a' + j;\n int temp = 0;\n for (int k = 0; k < n; ++k) {\n int temp1 = 0;\n int flag = 1;\n for (int l = 0; l < s[k].size(); ++l) {\n if (s[k][l] == x || s[k][l] == y)\n temp1++;\n else {\n flag = 0;\n break;\n }\n }\n if (flag) temp += temp1;\n }\n ans = max(ans, temp);\n }\n }\n cout << ans << endl;\n return 0;\n}","item":{"problem_id":"593A","pseudocode":"maxn = const integer with maxn = 1e5 + 5\ndefine the main function\n n = integer\n s = string array of size 105\n read n\n for i = 0 to n exclusive\n s[i] = \" \"\n read s[i]\n end of the block\n ans = integer with ans = 0\n for i = 0 to 25\n for j = 0 to 25\n x = character with x = a + i\n y = character with y = a + j\n temp = integer with temp = 0\n for k = 0 to n exclusive\n temp1 = integer with temp1 = 0\n flag = integer with flag = 1\n for l = 0 to s[k].size() exclusive\n if (s[k][l] is x or s[k][l] is y)\n increment temp1\n else\n flag = 0\n break loop\n end of the block\n end of the block\n if (flag), temp = temp + temp1\n end of the block\n ans = max of ans and temp\n end of the block\n end of the block\n print ans\n return to indicate successful execution\nend of the block","testcases":[[["4","abb","cacc","aaa","bbb"],["9"]],[["5","a","a","bcbcb","cdecdecdecdecdecde","aaaa"],["6"]],[["1","a"],["1"]],[["2","z","z"],["2"]],[["5","abcde","fghij","klmno","pqrst","uvwxy"],["0"]],[["6","gggggg","gggggg","gggggg","gggggg","gggggg","gggggg"],["36"]],[["6","aaaaaa","aaaaaa","bbbbbb","bbbbbb","aaabbb","ababab"],["36"]],[["1","abc"],["0"]],[["2","abc","bca"],["0"]],[["3","ab","ba","zzz"],["4"]],[["3","ab","ba","zzzzz"],["5"]],[["5","zzz","zzzz","zz","z","aaaaaaaaaaaaaaaaaaaaaaaaaaa"],["37"]],[["26","q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m"],["2"]],[["5","zzz","zzzz","zz","z","aaaaaaaaaaaaaaaaaaaaaaaaaaaf"],["28"]],[["7","pavel","erika","alexxxxxxx","gracio","zhenya","sudarev","chelyaba"],["0"]],[["31","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml","fml"],["0"]],[["5","zloyfreid","graciocode","schooldiary","kazakov","evgesha"],["0"]],[["4","urkop","visualac","gnutl","wtf"],["0"]],[["3","aa","b","ccc"],["5"]],[["3","a","bd","caaaaaaa"],["9"]],[["4","aa","ax","ay","xxxx"],["8"]],[["5","c","bb","e","dd","f"],["4"]],[["2","aaaaa","aaaaa"],["10"]]]}} +{"instance_id":"pseudo_to_code_0.5k_193","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n n = int\n read n\n a = int array of size n\n cnt = int with cnt = 0\n for i = 1 to n inclusive read a[i]\n call sort on a + 1 and a + 1 + n\n if n equals 1 or 2\n print 0\n else if n is greater than 2\n minn = int with minn = a[1]\n mixx = int with mixx = a[n]\n for i = 2 to n - 1 inclusive\n if a[i] is between minn and mixx then increment cnt\n end of the block\n print cnt\n end of the block\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n int a[n];\n int cnt = 0;\n for (int i = 1; i <= n; i++) { cin >> a[i]; }\n sort(a + 1, a + 1 + n);\n if (n == 1 || n == 2)\n cout << 0 << endl;\n else if (n >= 3) {\n int minn = a[1];\n int mixx = a[n];\n for (int i = 2; i <= n - 1; i++) {\n if (a[i] > minn && a[i] < mixx) cnt++;\n }\n cout << cnt << endl;\n }\n return 0;\n}","item":{"problem_id":"768A","pseudocode":"define the main function\n n = int\n read n\n a = int array of size n\n cnt = int with cnt = 0\n for i = 1 to n inclusive read a[i]\n call sort on a + 1 and a + 1 + n\n if n equals 1 or 2\n print 0\n else if n is greater than 2\n minn = int with minn = a[1]\n mixx = int with mixx = a[n]\n for i = 2 to n - 1 inclusive\n if a[i] is between minn and mixx then increment cnt\n end of the block\n print cnt\n end of the block\n return to indicate successful execution\nend of the block","testcases":[[["2","1 5"],["0"]],[["3","1 2 5"],["1"]],[["4","1 2 3 4"],["2"]],[["8","7 8 9 4 5 6 1 2"],["6"]],[["1","1"],["0"]],[["1","100"],["0"]],[["205","5 5 3 3 6 2 9 3 8 9 6 6 10 8 1 5 3 3 1 2 9 9 9 3 9 10 3 9 8 3 5 6 6 4 6 9 2 9 10 9 5 6 6 7 4 2 6 3 4 1 10 1 7 2 7 7 3 2 6 5 5 2 9 3 8 8 7 6 6 4 2 2 6 2 3 5 7 2 2 10 1 4 6 9 2 3 7 2 2 7 4 4 9 10 7 5 8 6 5 3 6 10 2 7 5 6 6 8 3 3 9 4 3 5 7 9 3 2 1 1 3 2 1 9 3 1 4 4 10 2 5 5 8 1 4 8 5 3 1 10 8 6 5 8 3 5 4 5 4 4 6 7 2 8 10 8 7 6 6 9 6 7 1 10 3 2 5 10 4 4 5 4 3 4 8 5 3 8 10 3 10 9 7 2 1 8 6 4 6 5 8 10 2 6 7 4 9 4 5 1 8 7 10 3 1"],["174"]],[["4","1000000000 99999999 1000000000 1000000000"],["0"]],[["3","2 2 2"],["0"]],[["5","1 1 1 1 1"],["0"]],[["3","1 1 1"],["0"]],[["6","1 1 3 3 2 2"],["2"]],[["7","1 1 1 1 1 1 1"],["0"]],[["4","1 1 2 5"],["1"]],[["3","0 0 0"],["0"]],[["5","0 0 0 0 0"],["0"]],[["5","1 1 1 1 5"],["0"]],[["5","1 1 2 3 3"],["1"]],[["3","1 1 3"],["0"]],[["3","2 2 3"],["0"]],[["1","6"],["0"]],[["5","1 5 3 5 1"],["1"]],[["7","1 2 2 2 2 2 3"],["5"]],[["4","2 2 2 2"],["0"]],[["9","2 2 2 3 4 5 6 6 6"],["3"]],[["10","1 1 1 2 3 3 3 3 3 3"],["1"]],[["6","1 1 1 1 1 1"],["0"]],[["3","0 0 1"],["0"]],[["9","1 1 1 2 2 2 3 3 3"],["3"]],[["3","1 2 2"],["0"]],[["6","2 2 2 2 2 2"],["0"]],[["5","2 2 2 2 2"],["0"]],[["5","5 5 5 5 5"],["0"]],[["1","0"],["0"]],[["6","1 2 5 5 5 5"],["1"]],[["5","1 2 3 3 3"],["1"]],[["3","1 1 2"],["0"]],[["6","1 1 1 1 1 2"],["0"]],[["5","1 1 2 4 4"],["1"]],[["3","999999 5999999 9999999"],["1"]],[["4","1 1 5 5"],["0"]],[["9","1 1 1 2 2 2 4 4 4"],["3"]],[["5","1 3 4 5 1"],["2"]],[["5","3 3 3 3 3"],["0"]],[["5","1 1 2 2 2"],["0"]],[["5","2 1 1 1 3"],["1"]],[["5","0 0 0 1 2"],["1"]],[["4","2 2 2 3"],["0"]],[["7","1 1 1 1 5 5 5"],["0"]],[["5","1 2 3 4 4"],["2"]],[["2","5 4"],["0"]],[["4","5 5 5 5"],["0"]],[["5","1 1 1 5 5"],["0"]],[["2","1 1"],["0"]],[["1","3"],["0"]],[["3","2 1 2"],["0"]],[["4","1 2 2 2"],["0"]],[["8","1000000000 1000000000 1000000000 999999999 999999999 999999999 999999998 999999998"],["3"]],[["5","1 1 3 4 4"],["1"]],[["6","1 1 2 2 3 3"],["2"]],[["4","1 1 1 1"],["0"]],[["9","1 2 3 4 1 5 6 7 8"],["6"]],[["8","5 4 4 6 6 4 4 3"],["5"]],[["8","4 3 3 3 3 3 3 3"],["0"]],[["7","4 3 3 3 3 3 3"],["0"]],[["6","4 3 3 3 3 3"],["0"]],[["5","4 3 3 3 3"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_194","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\nlet n, m, p, a and b be integers\nvoid function solve\n read a, b and n\n let tmp be integer = a * 10\n for i = 0 to 10 exclusive\n if tmp % b = 0\n print tmp\n print \"0\" n - 1 times\n print new line\n return\n end of the block\n increase tmp\n end of the block\n print -1 and a new line\nend of the block\ndefine the main function\n ;\n declare integer variable T = 1\n call solve() T times\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int n, m, p, a, b;\nvoid solve() {\n cin >> a >> b >> n;\n int tmp = a * 10;\n for (int i = 0; i < 10; i++) {\n if (tmp % b == 0) {\n cout << tmp;\n for (int i = 0; i < n - 1; ++i) cout << \"0\";\n cout << endl;\n return;\n }\n tmp++;\n }\n cout << -1 << endl;\n}\nint main() {\n ;\n int T = 1;\n for (int i = 0; i < T; i++) { solve(); }\n return 0;\n}","item":{"problem_id":"260A","pseudocode":"let n, m, p, a and b be integers\nvoid function solve\n read a, b and n\n let tmp be integer = a * 10\n for i = 0 to 10 exclusive\n if tmp % b = 0\n print tmp\n print \"0\" n - 1 times\n print new line\n return\n end of the block\n increase tmp\n end of the block\n print -1 and a new line\nend of the block\ndefine the main function\n ;\n declare integer variable T = 1\n call solve() T times\n return to indicate successful execution\nend of the block","testcases":[[["5 4 5"],["520000"]],[["12 11 1"],["121"]],[["260 150 10"],["-1"]],[["78843 5684 42717"],["-1"]],[["93248 91435 1133"],["-1"]],[["63270 19953 5555"],["-1"]],[["12 11 3"],["12100"]],[["1 11 3"],["1100"]],[["3 40 1"],["-1"]],[["150 100 10"],["1500000000000"]],[["5 10 1"],["50"]],[["1 15 10"],["15000000000"]],[["3 13 2"],["390"]]]}} +{"instance_id":"pseudo_to_code_0.5k_195","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create ints n, na = 0, nb = 0, and ab = 0 and int arrays aa of size 110 and bb of size 110\n read n\n for a = 0 to n exclusive\n read aa[a]\n read bb[a]\n set na to na + aa[a]\n add bb[a] to nb\n if (aa[a] + bb[a]) modulo 2 is 1, set ab to 1\n end of the block\n if na modulo 2 is equal to 0 and nb modulo 2 is equal to 0\n print 0\n else if na % 2 is equal to 1, nb % 2 is equal to 1, and ab is 1\n print 1\n otherwise\n display -1\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, aa[110], bb[110], na = 0, nb = 0, ab = 0;\n cin >> n;\n for (int a = 0; a < n; a++) {\n cin >> aa[a];\n cin >> bb[a];\n na += aa[a];\n nb += bb[a];\n if ((aa[a] + bb[a]) % 2 == 1) ab = 1;\n }\n if (na % 2 == 0 && nb % 2 == 0) {\n cout << 0 << endl;\n } else if (na % 2 == 1 && nb % 2 == 1 && ab == 1) {\n cout << 1 << endl;\n } else\n cout << -1 << endl;\n}","item":{"problem_id":"353A","pseudocode":"define the main function\n create ints n, na = 0, nb = 0, and ab = 0 and int arrays aa of size 110 and bb of size 110\n read n\n for a = 0 to n exclusive\n read aa[a]\n read bb[a]\n set na to na + aa[a]\n add bb[a] to nb\n if (aa[a] + bb[a]) modulo 2 is 1, set ab to 1\n end of the block\n if na modulo 2 is equal to 0 and nb modulo 2 is equal to 0\n print 0\n else if na % 2 is equal to 1, nb % 2 is equal to 1, and ab is 1\n print 1\n otherwise\n display -1\nend of the block","testcases":[[["2","4 2","6 4"],["0"]],[["1","2 3"],["-1"]],[["3","1 4","2 3","4 4"],["1"]],[["5","5 4","5 4","1 5","5 5","3 3"],["1"]],[["20","1 3","5 2","5 2","2 6","2 4","1 1","1 3","1 4","2 6","4 2","5 6","2 2","6 2","4 3","2 1","6 2","6 5","4 5","2 4","1 4"],["-1"]],[["100","2 3","2 4","3 3","1 4","5 2","5 4","6 6","3 4","1 1","4 2","5 1","5 5","5 3","3 6","4 1","1 6","1 1","3 2","4 5","6 1","6 4","1 1","3 4","3 3","2 2","1 1","4 4","6 4","3 2","5 2","6 4","3 2","3 5","4 4","1 4","5 2","3 4","1 4","2 2","5 6","3 5","6 1","5 5","1 6","6 3","1 4","1 5","5 5","4 1","3 2","4 1","5 5","5 5","1 5","1 2","6 4","1 3","3 6","4 3","3 5","6 4","2 6","5 5","1 4","2 2","2 3","5 1","2 5","1 2","2 6","5 5","4 6","1 4","3 6","2 3","6 1","6 5","3 2","6 4","4 5","4 5","2 6","1 3","6 2","1 2","2 3","4 3","5 4","3 4","1 6","6 6","2 4","4 1","3 1","2 6","5 4","1 2","6 5","3 6","2 4"],["-1"]],[["1","2 4"],["0"]],[["1","1 1"],["-1"]],[["1","1 2"],["-1"]],[["2","1 1","3 3"],["0"]],[["2","1 1","2 2"],["-1"]],[["2","1 1","1 2"],["-1"]],[["5","1 2","6 6","1 1","3 3","6 1"],["1"]],[["5","5 4","2 6","6 2","1 4","6 2"],["0"]],[["10","4 1","3 2","1 2","2 6","3 5","2 1","5 2","4 6","5 6","3 1"],["0"]],[["10","6 1","4 4","2 6","6 5","3 6","6 3","2 4","5 1","1 6","1 5"],["-1"]],[["15","1 2","5 1","6 4","5 1","1 6","2 6","3 1","6 4","3 1","2 1","6 4","3 5","6 2","1 6","1 1"],["1"]],[["15","3 3","2 1","5 4","3 3","5 3","5 4","2 5","1 3","3 2","3 3","3 5","2 5","4 1","2 3","5 4"],["-1"]],[["20","1 5","6 4","4 3","6 2","1 1","1 5","6 3","2 3","3 6","3 6","3 6","2 5","4 3","4 6","5 5","4 6","3 4","4 2","3 3","5 2"],["0"]],[["20","2 1","6 5","3 1","2 5","3 5","4 1","1 1","5 4","5 1","2 4","1 5","3 2","1 2","3 5","5 2","1 2","1 3","4 2","2 3","4 5"],["-1"]],[["25","4 1","6 3","1 3","2 3","2 4","6 6","4 2","4 2","1 5","5 4","1 2","2 5","3 6","4 1","3 4","2 6","6 1","5 6","6 6","4 2","1 5","3 3","3 3","6 5","1 4"],["-1"]],[["25","5 5","4 3","2 5","4 3","4 6","4 2","5 6","2 1","5 4","6 6","1 3","1 4","2 3","5 6","5 4","5 6","5 4","6 3","3 5","1 3","2 5","2 2","4 4","2 1","4 4"],["-1"]],[["30","3 5","2 5","1 6","1 6","2 4","5 5","5 4","5 6","5 4","2 1","2 4","1 6","3 5","1 1","3 6","5 5","1 6","3 4","1 4","4 6","2 1","3 3","1 3","4 5","1 4","1 6","2 1","4 6","3 5","5 6"],["1"]],[["30","2 3","3 1","6 6","1 3","5 5","3 6","4 5","2 1","1 3","2 3","4 4","2 4","6 4","2 4","5 4","2 1","2 5","2 5","4 2","1 4","2 6","3 2","3 2","6 6","4 2","3 4","6 3","6 6","6 6","5 5"],["1"]],[["35","6 1","4 3","1 2","4 3","6 4","4 6","3 1","5 5","3 4","5 4","4 6","1 6","2 4","6 6","5 4","5 2","1 3","1 4","3 5","1 4","2 3","4 5","4 3","6 1","5 3","3 2","5 6","3 5","6 5","4 1","1 3","5 5","4 6","6 1","1 3"],["1"]],[["35","4 3","5 6","4 5","2 5","6 6","4 1","2 2","4 2","3 4","4 1","6 6","6 3","1 5","1 5","5 6","4 2","4 6","5 5","2 2","5 2","1 2","4 6","6 6","6 5","2 1","3 5","2 5","3 1","5 3","6 4","4 6","5 6","5 1","3 4","3 5"],["1"]],[["40","5 6","1 1","3 3","2 6","6 6","5 4","6 4","3 5","1 3","4 4","4 4","2 5","1 3","3 6","5 2","4 3","4 4","5 6","2 3","1 1","3 1","1 1","1 5","4 3","5 5","3 4","6 6","5 6","2 2","6 6","2 1","2 4","5 2","2 2","1 1","1 4","4 2","3 5","5 5","4 5"],["-1"]],[["40","3 2","5 3","4 6","3 5","6 1","5 2","1 2","6 2","5 3","3 2","4 4","3 3","5 2","4 5","1 4","5 1","3 3","1 3","1 3","2 1","3 6","4 2","4 6","6 2","2 5","2 2","2 5","3 3","5 3","2 1","3 2","2 3","6 3","6 3","3 4","3 2","4 3","5 4","2 4","4 6"],["-1"]],[["45","2 4","3 4","6 1","5 5","1 1","3 5","4 3","5 2","3 6","6 1","4 4","6 1","2 1","6 1","3 6","3 3","6 1","1 2","1 5","6 5","1 3","5 6","6 1","4 5","3 6","2 2","1 2","4 5","5 6","1 5","6 2","2 4","3 3","3 1","6 5","6 5","2 1","5 2","2 1","3 3","2 2","1 4","2 2","3 3","2 1"],["-1"]],[["45","6 6","1 6","1 2","3 5","4 4","2 1","5 3","2 1","5 2","5 3","1 4","5 2","4 2","3 6","5 2","1 5","4 4","5 5","6 5","2 1","2 6","5 5","2 1","6 1","1 6","6 5","2 4","4 3","2 6","2 4","6 5","6 4","6 3","6 6","2 1","6 4","5 6","5 4","1 5","5 1","3 3","5 6","2 5","4 5","3 6"],["-1"]],[["50","4 4","5 1","6 4","6 2","6 2","1 4","5 5","4 2","5 5","5 4","1 3","3 5","6 1","6 1","1 4","4 3","5 1","3 6","2 2","6 2","4 4","2 3","4 2","6 5","5 6","2 2","2 4","3 5","1 5","3 2","3 4","5 6","4 6","1 6","4 5","2 6","2 2","3 5","6 4","5 1","4 3","3 4","3 5","3 3","2 3","3 2","2 2","1 4","3 1","4 4"],["1"]],[["50","1 2","1 4","1 1","4 5","4 4","3 2","4 5","3 5","1 1","3 4","3 2","2 4","2 6","2 6","3 2","4 6","1 6","3 1","1 6","2 1","4 1","1 6","4 3","6 6","5 2","6 4","2 1","4 3","6 4","5 1","5 5","3 1","1 1","5 5","2 2","2 3","2 3","3 5","5 5","1 6","1 5","3 6","3 6","1 1","3 3","2 6","5 5","1 3","6 3","6 6"],["-1"]],[["55","3 2","5 6","5 1","3 5","5 5","1 5","5 4","6 3","5 6","4 2","3 1","1 2","5 5","1 1","5 2","6 3","5 4","3 6","4 6","2 6","6 4","1 4","1 6","4 1","2 5","4 3","2 1","2 1","6 2","3 1","2 5","4 4","6 3","2 2","3 5","5 1","3 6","5 4","4 6","6 5","5 6","2 2","3 2","5 2","6 5","2 2","5 3","3 1","4 5","6 4","2 4","1 2","5 6","2 6","5 2"],["0"]],[["55","4 6","3 3","6 5","5 3","5 6","2 3","2 2","3 4","3 1","5 4","5 4","2 4","3 4","4 5","1 5","6 3","1 1","5 1","3 4","1 5","3 1","2 5","3 3","4 3","3 3","3 1","6 6","3 3","3 3","5 6","5 3","3 5","1 4","5 5","1 3","1 4","3 5","3 6","2 4","2 4","5 1","6 4","5 1","5 5","1 1","3 2","4 3","5 4","5 1","2 4","4 3","6 1","3 4","1 5","6 3"],["-1"]],[["60","2 6","1 4","3 2","1 2","3 2","2 4","6 4","4 6","1 3","3 1","6 5","2 4","5 4","4 2","1 6","3 4","4 5","5 2","1 5","5 4","3 4","3 4","4 4","4 1","6 6","3 6","2 4","2 1","4 4","6 5","3 1","4 3","1 3","6 3","5 5","1 4","3 1","3 6","1 5","3 1","1 5","4 4","1 3","2 4","6 2","4 1","5 3","3 4","5 6","1 2","1 6","6 3","1 6","3 6","3 4","6 2","4 6","2 3","3 3","3 3"],["-1"]],[["60","2 3","4 6","2 4","1 3","5 6","1 5","1 2","1 3","5 6","4 3","4 2","3 1","1 3","3 5","1 5","3 4","2 4","3 5","4 5","1 2","3 1","1 5","2 5","6 2","1 6","3 3","6 2","5 3","1 3","1 4","6 4","6 3","4 2","4 2","1 4","1 3","3 2","3 1","2 1","1 2","3 1","2 6","1 4","3 6","3 3","1 5","2 4","5 5","6 2","5 2","3 3","5 3","3 4","4 5","5 6","2 4","5 3","3 1","2 4","5 4"],["-1"]],[["65","5 4","3 3","1 2","4 3","3 5","1 5","4 5","2 6","1 2","1 5","6 3","2 6","4 3","3 6","1 5","3 5","4 6","2 5","6 5","1 4","3 4","4 3","1 4","2 5","6 5","3 1","4 3","1 2","1 1","6 1","5 2","3 2","1 6","2 6","3 3","6 6","4 6","1 5","5 1","4 5","1 4","3 2","5 4","4 2","6 2","1 3","4 2","5 3","6 4","3 6","1 2","6 1","6 6","3 3","4 2","3 5","4 6","4 1","5 4","6 1","5 1","5 6","6 1","4 6","5 5"],["1"]],[["65","5 4","6 3","5 4","4 5","5 3","3 6","1 3","3 1","1 3","6 1","6 4","1 3","2 2","4 6","4 1","5 6","6 5","1 1","1 3","6 6","4 1","2 4","5 4","4 1","5 5","5 3","6 2","2 6","4 2","2 2","6 2","3 3","4 5","4 3","3 1","1 4","4 5","3 2","5 5","4 6","5 1","3 4","5 4","5 2","1 6","4 2","3 4","3 4","1 3","1 2","3 3","3 6","6 4","4 6","6 2","6 5","3 2","2 1","6 4","2 1","1 5","5 2","6 5","3 6","5 1"],["1"]],[["70","4 1","2 6","1 1","5 6","5 1","2 3","3 5","1 1","1 1","4 6","4 3","1 5","2 2","2 3","3 1","6 4","3 1","4 2","5 4","1 3","3 5","5 2","5 6","4 4","4 5","2 2","4 5","3 2","3 5","2 5","2 6","5 5","2 6","5 1","1 1","2 5","3 1","1 2","6 4","6 5","5 5","5 1","1 5","2 2","6 3","4 3","6 2","5 5","1 1","6 2","6 6","3 4","2 2","3 5","1 5","2 5","4 5","2 4","6 3","5 1","2 6","4 2","1 4","1 6","6 2","5 2","5 6","2 5","5 6","5 5"],["-1"]],[["70","4 3","6 4","5 5","3 1","1 2","2 5","4 6","4 2","3 2","4 2","1 5","2 2","4 3","1 2","6 1","6 6","1 6","5 1","2 2","6 3","4 2","4 3","1 2","6 6","3 3","6 5","6 2","3 6","6 6","4 6","5 2","5 4","3 3","1 6","5 6","2 3","4 6","1 1","1 2","6 6","1 1","3 4","1 6","2 6","3 4","6 3","5 3","1 2","2 3","4 6","2 1","6 4","4 6","4 6","4 2","5 5","3 5","3 2","4 3","3 6","1 4","3 6","1 4","1 6","1 5","5 6","4 4","3 3","3 5","2 2"],["0"]],[["75","1 3","4 5","4 1","6 5","2 1","1 4","5 4","1 5","5 3","1 2","4 1","1 1","5 1","5 3","1 5","4 2","2 2","6 3","1 2","4 3","2 5","5 3","5 5","4 1","4 6","2 5","6 1","2 4","6 4","5 2","6 2","2 4","1 3","5 4","6 5","5 4","6 4","1 5","4 6","1 5","1 1","4 4","3 5","6 3","6 5","1 5","2 1","1 5","6 6","2 2","2 2","4 4","6 6","5 4","4 5","3 2","2 4","1 1","4 3","3 2","5 4","1 6","1 2","2 2","3 5","2 6","1 1","2 2","2 3","6 2","3 6","4 4","5 1","4 1","4 1"],["0"]],[["75","1 1","2 1","5 5","6 5","6 3","1 6","6 1","4 4","2 1","6 2","3 1","6 4","1 6","2 2","4 3","4 2","1 2","6 2","4 2","5 1","1 2","3 2","6 6","6 3","2 4","4 1","4 1","2 4","5 5","2 3","5 5","4 5","3 1","1 5","4 3","2 3","3 5","4 6","5 6","1 6","2 3","2 2","1 2","5 6","1 4","1 5","1 3","6 2","1 2","4 2","2 1","1 3","6 4","4 1","5 2","6 2","3 5","2 3","4 2","5 1","5 6","3 2","2 1","6 6","2 1","6 2","1 1","3 2","1 2","3 5","4 6","1 3","3 4","5 5","6 2"],["1"]],[["80","3 1","6 3","2 2","2 2","6 3","6 1","6 5","1 4","3 6","6 5","1 3","2 4","1 4","3 1","5 3","5 3","1 4","2 5","4 3","4 4","4 5","6 1","3 1","2 6","4 2","3 1","6 5","2 6","2 2","5 1","1 3","5 1","2 1","4 3","6 3","3 5","4 3","5 6","3 3","4 1","5 1","6 5","5 1","2 5","6 1","3 2","4 3","3 3","5 6","1 6","5 2","1 5","5 6","6 4","2 2","4 2","4 6","4 2","4 4","6 5","5 2","6 2","4 6","6 4","4 3","5 1","4 1","3 5","3 2","3 2","5 3","5 4","3 4","1 3","1 2","6 6","6 3","6 1","5 6","3 2"],["0"]],[["80","4 5","3 3","3 6","4 5","3 4","6 5","1 5","2 5","5 6","5 1","5 1","1 2","5 5","5 1","2 3","1 1","4 5","4 1","1 1","5 5","5 6","5 2","5 4","4 2","6 2","5 3","3 2","4 2","1 3","1 6","2 1","6 6","4 5","6 4","2 2","1 6","6 2","4 3","2 3","4 6","4 6","6 2","3 4","4 3","5 5","1 6","3 2","4 6","2 3","1 6","5 4","4 2","5 4","1 1","4 3","5 1","3 6","6 2","3 1","4 1","5 3","2 2","3 4","3 6","3 5","5 5","5 1","3 5","2 6","6 3","6 5","3 3","5 6","1 2","3 1","6 3","3 4","6 6","6 6","1 2"],["-1"]],[["85","6 3","4 1","1 2","3 5","6 4","6 2","2 6","1 2","1 5","6 2","1 4","6 6","2 4","4 6","4 5","1 6","3 1","2 5","5 1","5 2","3 5","1 1","4 1","2 3","1 1","3 3","6 4","1 4","1 1","3 6","1 5","1 6","2 5","2 2","5 1","6 6","1 3","1 5","5 6","4 5","4 3","5 5","1 3","6 3","4 6","2 4","5 6","6 2","4 5","1 4","1 4","6 5","1 6","6 1","1 6","5 5","2 1","5 2","2 3","1 6","1 6","1 6","5 6","2 4","6 5","6 5","4 2","5 4","3 4","4 3","6 6","3 3","3 2","3 6","2 5","2 1","2 5","3 4","1 2","5 4","6 2","5 1","1 4","3 4","4 5"],["0"]],[["85","3 1","3 2","6 3","1 3","2 1","3 6","1 4","2 5","6 5","1 6","1 5","1 1","4 3","3 5","4 6","3 2","6 6","4 4","4 1","5 5","4 2","6 2","2 2","4 5","6 1","3 4","4 5","3 5","4 2","3 5","4 4","3 1","4 4","6 4","1 4","5 5","1 5","2 2","6 5","5 6","6 5","3 2","3 2","6 1","6 5","2 1","4 6","2 1","3 1","5 6","1 3","5 4","1 4","1 4","5 3","2 3","1 3","2 2","5 3","2 3","2 3","1 3","3 6","4 4","6 6","6 2","5 1","5 5","5 5","1 2","1 4","2 4","3 6","4 6","6 3","6 4","5 5","3 2","5 4","5 4","4 5","6 4","2 1","5 2","5 1"],["-1"]],[["90","5 2","5 5","5 1","4 6","4 3","5 3","5 6","5 1","3 4","1 3","4 2","1 6","6 4","1 2","6 1","4 1","6 2","6 5","6 2","5 4","3 6","1 1","5 5","2 2","1 6","3 5","6 5","1 6","1 5","2 3","2 6","2 3","3 3","1 3","5 1","2 5","3 6","1 2","4 4","1 6","2 3","1 5","2 5","1 3","2 2","4 6","3 6","6 3","1 2","4 3","4 5","4 6","3 2","6 5","6 2","2 5","2 4","1 3","1 6","4 3","1 3","6 4","4 6","4 1","1 1","4 1","4 4","6 2","6 5","1 1","2 2","3 1","1 4","6 2","5 2","1 4","1 3","6 5","3 2","6 4","3 4","2 6","2 2","6 3","4 6","1 2","4 2","3 4","2 3","1 5"],["-1"]],[["90","1 4","3 5","4 2","2 5","4 3","2 6","2 6","3 2","4 4","6 1","4 3","2 3","5 3","6 6","2 2","6 3","4 1","4 4","5 6","6 4","4 2","5 6","4 6","4 4","6 4","4 1","5 3","3 2","4 4","5 2","5 4","6 4","1 2","3 3","3 4","6 4","1 6","4 2","3 2","1 1","2 2","5 1","6 6","4 1","5 2","3 6","2 1","2 2","4 6","6 5","4 4","5 5","5 6","1 6","1 4","5 6","3 6","6 3","5 6","6 5","5 1","6 1","6 6","6 3","1 5","4 5","3 1","6 6","3 4","6 2","1 4","2 2","3 2","5 6","2 4","1 4","6 3","4 6","1 4","5 2","1 2","6 5","1 5","1 4","4 2","2 5","3 2","5 1","5 4","5 3"],["-1"]],[["95","4 3","3 2","5 5","5 3","1 6","4 4","5 5","6 5","3 5","1 5","4 2","5 1","1 2","2 3","6 4","2 3","6 3","6 5","5 6","1 4","2 6","2 6","2 5","2 1","3 1","3 5","2 2","6 1","2 4","4 6","6 6","6 4","3 2","5 1","4 3","6 5","2 3","4 1","2 5","6 5","6 5","6 5","5 1","5 4","4 6","3 2","2 5","2 6","4 6","6 3","6 4","5 6","4 6","2 4","3 4","1 4","2 4","2 3","5 6","6 4","3 1","5 1","3 6","3 5","2 6","6 3","4 3","3 1","6 1","2 2","6 3","2 2","2 2","6 4","6 1","2 1","5 6","5 4","5 2","3 4","3 6","2 1","1 6","5 5","2 6","2 3","3 6","1 3","1 5","5 1","1 2","2 2","5 3","6 4","4 5"],["0"]],[["95","4 5","5 6","3 2","5 1","4 3","4 1","6 1","5 2","2 4","5 3","2 3","6 4","4 1","1 6","2 6","2 3","4 6","2 4","3 4","4 2","5 5","1 1","1 5","4 3","4 5","6 2","6 1","6 3","5 5","4 1","5 1","2 3","5 1","3 6","6 6","4 5","4 4","4 3","1 6","6 6","4 6","6 4","1 2","6 2","4 6","6 6","5 5","6 1","5 2","4 5","6 6","6 5","4 4","1 5","4 6","4 1","3 6","5 1","3 1","4 6","4 5","1 3","5 4","4 5","2 2","6 1","5 2","6 5","2 2","1 1","6 3","6 1","2 6","3 3","2 1","4 6","2 4","5 5","5 2","3 2","1 2","6 6","6 2","5 1","2 6","5 2","2 2","5 5","3 5","3 3","2 6","5 3","4 3","1 6","5 4"],["-1"]],[["100","1 1","3 5","2 1","1 2","3 4","5 6","5 6","6 1","5 5","2 4","5 5","5 6","6 2","6 6","2 6","1 4","2 2","3 2","1 3","5 5","6 3","5 6","1 1","1 2","1 2","2 1","2 3","1 6","4 3","1 1","2 5","2 4","4 4","1 5","3 3","6 1","3 5","1 1","3 6","3 1","4 2","4 3","3 6","6 6","1 6","6 2","2 5","5 4","6 3","1 4","2 6","6 2","3 4","6 1","6 5","4 6","6 5","4 4","3 1","6 3","5 1","2 4","5 1","1 2","2 4","2 1","6 6","5 3","4 6","6 3","5 5","3 3","1 1","6 5","4 3","2 6","1 5","3 5","2 4","4 5","1 6","2 3","6 3","5 5","2 6","2 6","3 4","3 2","6 1","3 4","6 4","3 3","2 3","5 1","3 1","6 2","2 3","6 4","1 4","1 2"],["-1"]],[["100","1 1","5 5","1 2","5 3","5 5","2 2","1 5","3 4","3 2","1 3","5 6","4 5","2 1","5 5","2 2","1 6","6 1","5 1","4 1","4 6","3 5","6 1","2 3","5 6","3 6","2 3","5 6","1 6","3 2","2 2","3 3","6 5","5 5","1 4","5 6","6 4","1 4","1 2","2 6","3 2","6 4","5 3","3 3","6 4","4 6","2 2","5 6","5 1","1 2","3 4","4 5","1 1","3 4","5 2","4 5","3 3","1 1","3 4","1 6","2 4","1 3","3 2","6 5","1 6","3 6","2 3","2 6","5 1","5 5","5 6","4 1","6 2","3 6","5 3","2 2","2 4","6 6","3 6","4 6","2 5","5 3","1 2","3 4","3 4","6 2","2 4","2 2","4 6","3 5","4 2","5 6","4 2","2 3","6 2","5 6","2 1","3 3","6 6","4 3","4 2"],["1"]],[["1","2 2"],["0"]],[["3","2 4","6 6","3 3"],["-1"]],[["2","3 6","4 1"],["1"]],[["3","1 1","1 1","3 3"],["-1"]],[["3","2 3","1 1","2 3"],["1"]],[["3","2 2","2 1","1 2"],["1"]],[["3","1 1","1 1","1 1"],["-1"]]]}} +{"instance_id":"pseudo_to_code_0.5k_196","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n let n = integer\n read n\n if n is odd\n print 1\n else\n print 0\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n;\n cin >> n;\n if (n % 2)\n cout << \"1\\n\";\n else\n cout << \"0\\n\";\n}","item":{"problem_id":"952A","pseudocode":"define the main function\n let n = integer\n read n\n if n is odd\n print 1\n else\n print 0\nend of the block","testcases":[[["13"],["1"]],[["927"],["1"]],[["48"],["0"]],[["10"],["0"]],[["999"],["1"]],[["142"],["0"]],[["309"],["1"]],[["572"],["0"]],[["835"],["1"]],[["990"],["0"]],[["168"],["0"]],[["431"],["1"]],[["694"],["0"]],[["957"],["1"]],[["932"],["0"]]]}} +{"instance_id":"pseudo_to_code_0.5k_197","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndefine the main function\n create n, m as integers\n get n, m\n create str, cmd as strings\n get str\n create x, y as integers\n create c1, c2 as characters\n for integer i=0 to m-1 with increment i do\n get x, y, c1, c2\n for integer j=x to y with increment j do\n if str[j-1] is equal to c1 then assign c2 to str[j-1]\n end of the block\n end of the block\n print str\nend of the block\n\n[CODE]:","reference_output":"int main() {\n int n, m;\n cin >> n >> m;\n string str, cmd;\n cin >> str;\n int x, y;\n char c1, c2;\n for (int i = 0; i < m; i++) {\n cin >> x >> y >> c1 >> c2;\n for (int j = x; j <= y; j++) {\n if (str[j - 1] == c1) str[j - 1] = c2;\n }\n }\n cout << str << endl;\n}","item":{"problem_id":"897A","pseudocode":"define the main function\n create n, m as integers\n get n, m\n create str, cmd as strings\n get str\n create x, y as integers\n create c1, c2 as characters\n for integer i=0 to m-1 with increment i do\n get x, y, c1, c2\n for integer j=x to y with increment j do\n if str[j-1] is equal to c1 then assign c2 to str[j-1]\n end of the block\n end of the block\n print str\nend of the block","testcases":[[["3 1","ioi","1 1 i n"],["noi"]],[["5 3","wxhak","3 3 h x","1 5 x a","1 3 w g"],["gaaak"]],[["9 51","bhfbdcgff","2 3 b b","2 8 e f","3 8 g f","5 7 d a","1 5 e b","3 4 g b","6 7 c d","3 6 e g","3 6 e h","5 6 a e","7 9 a c","4 9 a h","3 7 c b","6 9 b g","1 7 h b","4 5 a e","3 9 f a","1 2 c h","4 8 a c","3 5 e d","3 4 g f","2 3 d h","2 3 d e","1 7 d g","2 6 e g","2 3 d g","5 5 h h","2 8 g d","8 9 a f","5 9 c e","1 7 f d","1 6 e e","5 7 c a","8 9 b b","2 6 e b","6 6 g h","1 2 b b","1 5 a f","5 8 f h","1 5 e g","3 9 f h","6 8 g a","4 6 h g","1 5 f a","5 6 a c","4 8 e d","1 4 d g","7 8 b f","5 6 h b","3 9 c e","1 9 b a"],["aahaddddh"]],[["28 45","dcbbaddjhbeefjadjchgkhgggfha","10 25 c a","13 19 a f","12 28 e d","12 27 e a","9 20 b e","7 17 g d","22 26 j j","8 16 c g","14 16 a d","3 10 f c","10 26 d b","8 17 i e","10 19 d i","6 21 c j","7 22 b k","17 19 a i","4 18 j k","8 25 a g","10 27 j e","9 18 g d","16 23 h a","17 26 k e","8 16 h f","1 15 d f","22 28 k k","11 20 c k","6 11 b h","17 17 e i","15 22 g h","8 18 c f","4 16 e a","8 25 b c","6 24 d g","5 9 f j","12 19 i h","4 25 e f","15 25 c j","15 27 e e","11 20 b f","19 27 e k","2 21 d a","9 27 k e","14 24 b a","3 6 i g","2 26 k f"],["fcbbajjfjaaefefehfahfagggfha"]],[["87 5","nfinedeojadjmgafnaogekfjkjfncnliagfchjfcmellgigjjcaaoeakdolchjcecljdeblmheimkibkgdkcdml","47 56 a k","51 81 o d","5 11 j h","48 62 j d","16 30 k m"],["nfinedeohadjmgafnaogemfjmjfncnliagfchjfcmellgigddckkdekkddlchdcecljdeblmheimkibkgdkcdml"]],[["5 16","acfbb","1 2 e f","2 5 a f","2 3 b e","4 4 f a","2 3 f a","1 2 b e","4 5 c d","2 4 e c","1 4 e a","1 3 d c","3 5 e b","3 5 e b","2 2 e d","1 3 e c","3 3 a e","1 5 a a"],["acebb"]],[["94 13","bcaaaaaaccacddcdaacbdaabbcbaddbccbccbbbddbadddcccbddadddaadbdababadaacdcdbcdadabdcdcbcbcbcbbcd","52 77 d d","21 92 d b","45 48 c b","20 25 d a","57 88 d b","3 91 b d","64 73 a a","5 83 b d","2 69 c c","28 89 a b","49 67 c b","41 62 a c","49 87 b c"],["bcaaaaaaccacddcdaacddaaddcdbdddccdccddddddbdddddcdddcdddccdddcdcdcdcccdcddcdcdcddcdcdcdcdcdbcd"]],[["67 39","acbcbccccbabaabcabcaaaaaaccbcbbcbaaaacbbcccbcbabbcacccbbabbabbabaac","4 36 a b","25 38 a a","3 44 b c","35 57 b a","4 8 a c","20 67 c a","30 66 b b","27 40 a a","2 56 a b","10 47 c a","22 65 c b","29 42 a b","1 46 c b","57 64 b c","20 29 b a","14 51 c a","12 55 b b","20 20 a c","2 57 c a","22 60 c b","16 51 c c","31 64 a c","17 30 c a","23 36 c c","28 67 a c","37 40 a c","37 50 b c","29 48 c b","2 34 b c","21 53 b a","26 63 a c","23 28 c a","51 56 c b","32 61 b b","64 67 b b","21 67 b c","8 53 c c","40 62 b b","32 38 c c"],["accccccccaaaaaaaaaaaaaaaaaaaccccccccccccccccccccccccccccccccccccccc"]],[["53 33","hhcbhfafeececbhadfbdbehdfacfchbhdbfebdfeghebfcgdhehfh","27 41 h g","18 35 c b","15 46 h f","48 53 e g","30 41 b c","12 30 b f","10 37 e f","18 43 a h","10 52 d a","22 48 c e","40 53 f d","7 12 b h","12 51 f a","3 53 g a","19 41 d h","22 29 b h","2 30 a b","26 28 e h","25 35 f a","19 31 h h","44 44 d e","19 22 e c","29 44 d h","25 33 d h","3 53 g c","18 44 h b","19 28 f e","3 22 g h","8 17 c a","37 51 d d","3 28 e h","27 50 h h","27 46 f b"],["hhcbhfbfhfababbbbbbbbbbbbbbbbbeaaeaaeaaeabebdeaahahdh"]],[["83 10","fhbecdgadecabbbecedcgfdcefcbgechbedagecgdgfgdaahchdgchbeaedgafdefecdchceececfcdhcdh","9 77 e e","26 34 b g","34 70 b a","40 64 e g","33 78 h f","14 26 a a","17 70 d g","56 65 a c","8 41 d c","11 82 c b"],["fhbecdgacebabbbebegbgfgbefbggebhgegagebgggfggaafbfggbfagbgggbfggfebgbfbeebebfbdhbdh"]],[["1 4","e","1 1 c e","1 1 e a","1 1 e c","1 1 d a"],["a"]],[["71 21","aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","61 61 a a","32 56 a a","10 67 a a","7 32 a a","26 66 a a","41 55 a a","49 55 a a","4 61 a a","53 59 a a","37 58 a a","7 63 a a","39 40 a a","51 64 a a","27 37 a a","22 71 a a","4 45 a a","7 8 a a","43 46 a a","19 28 a a","51 54 a a","14 67 a a"],["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"]],[["30 4","eaaddabedcbbcccddbabdecadcecce","2 17 c a","16 29 e e","16 21 c b","7 11 b c"],["eaaddacedacbaaaddbabdecadcecce"]],[["48 30","aaaabaabbaababbbaabaabaababbabbbaabbbaabaaaaaaba","3 45 a b","1 14 a a","15 32 a b","37 47 a b","9 35 a b","36 39 b b","6 26 a b","36 44 a a","28 44 b a","29 31 b a","20 39 a a","45 45 a b","21 32 b b","7 43 a b","14 48 a b","14 33 a b","39 44 a a","9 36 b b","4 23 b b","9 42 b b","41 41 b a","30 47 a b","8 42 b a","14 38 b b","3 15 a a","35 47 b b","14 34 a b","38 43 a b","1 35 b a","16 28 b a"],["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbb"]],[["89 29","babaabaaabaaaababbbbbbbabbbaaaaababbaababababbababaaabbababaaabbbbaaabaaaaaabaaabaabbabab","39 70 b b","3 56 b b","5 22 b a","4 39 a b","41 87 b b","34 41 a a","10 86 a b","29 75 a b","2 68 a a","27 28 b b","42 51 b a","18 61 a a","6 67 b a","47 63 a a","8 68 a b","4 74 b a","19 65 a b","8 55 a b","5 30 a a","3 65 a b","16 57 a b","34 56 b a","1 70 a b","59 68 b b","29 57 b a","47 49 b b","49 73 a a","32 61 b b","29 42 a a"],["bbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbaaaabbbbbbbbbbbbbab"]],[["59 14","fbebcfabdefbaaedcefdeecababcabebadfbccaaedaebfdaefdbbcbebbe","5 32 e f","8 46 e e","31 43 e f","3 10 e a","53 54 f d","55 59 d a","39 58 e b","54 56 f a","9 40 b e","28 37 d a","7 35 e b","7 56 c f","23 26 e a","15 44 e d"],["fbabcfabdffbaafdfffdfffababfabfbaafdffaafdabbfdabfdbbfbbbbe"]],[["7 17","bbaabab","3 5 a b","5 7 a a","5 5 a a","4 4 b a","7 7 a a","5 6 b b","1 3 b a","6 7 a b","4 6 a b","6 6 a a","2 4 b a","1 7 b a","4 6 b b","2 5 b b","2 5 a b","1 4 a a","4 4 b a"],["abbabaa"]],[["100 1","debaaagbfdgehagadabfgheegggfghghgeeeabgceffeffggcbcegfgebbdhebhfagcgadcbdbabddbcadgbgdebdfehceehcaef","13 99 f c"],["debaaagbfdgehagadabcgheegggcghghgeeeabgcecceccggcbcegcgebbdhebhcagcgadcbdbabddbcadgbgdebdcehceehcaef"]],[["1 1","a","1 1 a b"],["b"]],[["100 1","aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","1 100 a b"],["bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"]],[["2 2","aa","1 2 a b","1 2 b c"],["cc"]],[["3 3","aaa","1 3 a b","1 3 b c","1 3 c d"],["ddd"]],[["2 2","aa","2 2 a b","1 1 a b"],["bb"]]]}} +{"instance_id":"pseudo_to_code_0.5k_198","input_prompt":"[TASK]:\nYou will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.\n\n[INSTRUCTION]:\nThe following libraries are already included in the code.\n```cpp\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n```\nDo not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.\n\n[PSEUDOCODE]:\ndeclare integer p and 2d array of integers dp with size 2005 by 2005\nvoid function helper\n set first sizeof(dp) bytes at the pointer dp to 0\n for i from 0 to p exclusive, change dp[i][0] to 1\n for x from 1 to p exclusive\n for i = 1 to p exclusive, set dp[x][i] to ((dp[x][i - 1]) * x) % p\n end of the block\nend of the block\nisPrimeRoot is a bool function with int argument x\n declare int curr = 0\n for k from 0 to p - 2 exclusive\n add dp[x][k] to curr\n return false if curr % p = 0\n end of the block\n set curr to curr + dp[x][p - 2]\n return false if curr % p != 0\n return true\nend of the block\ninteger function solve\n if p is equal to 2, return 1\n call helper()\n create integer ans = 0\n change x from 1 to p exclusive in a loop\n if isPrimeRoot(x) returned true, increment ans\n end of the block\n return ans\nend of the block\ndefine the main function\n read p\n declare integer ans = result of the solve()\n print ans\n return to indicate successful execution\nend of the block\n\n[CODE]:","reference_output":"int p, dp[2005][2005];\nvoid helper() {\n memset(dp, 0, sizeof(dp));\n for (int i = 0; i < p; i++) { dp[i][0] = 1; }\n for (int x = 1; x < p; x++) {\n for (int i = 1; i < p; i++) { dp[x][i] = ((dp[x][i - 1]) * x) % p; }\n }\n}\nbool isPrimeRoot(int x) {\n int curr = 0;\n for (int k = 0; k < p - 2; k++) {\n curr += dp[x][k];\n if (curr % p == 0) { return false; }\n }\n curr = curr + dp[x][p - 2];\n if (curr % p != 0) { return false; }\n return true;\n}\nint solve() {\n if (p == 2) return 1;\n helper();\n int ans = 0;\n for (int x = 1; x < p; x++) {\n if (isPrimeRoot(x)) { ans++; }\n }\n return ans;\n}\nint main() {\n cin >> p;\n int ans = solve();\n cout << ans << endl;\n return 0;\n}","item":{"problem_id":"284A","pseudocode":"declare integer p and 2d array of integers dp with size 2005 by 2005\nvoid function helper\n set first sizeof(dp) bytes at the pointer dp to 0\n for i from 0 to p exclusive, change dp[i][0] to 1\n for x from 1 to p exclusive\n for i = 1 to p exclusive, set dp[x][i] to ((dp[x][i - 1]) * x) % p\n end of the block\nend of the block\nisPrimeRoot is a bool function with int argument x\n declare int curr = 0\n for k from 0 to p - 2 exclusive\n add dp[x][k] to curr\n return false if curr % p = 0\n end of the block\n set curr to curr + dp[x][p - 2]\n return false if curr % p != 0\n return true\nend of the block\ninteger function solve\n if p is equal to 2, return 1\n call helper()\n create integer ans = 0\n change x from 1 to p exclusive in a loop\n if isPrimeRoot(x) returned true, increment ans\n end of the block\n return ans\nend of the block\ndefine the main function\n read p\n declare integer ans = result of the solve()\n print ans\n return to indicate successful execution\nend of the block","testcases":[[["3"],["1"]],[["5"],["2"]],[["7"],["2"]],[["11"],["4"]],[["17"],["8"]],[["19"],["6"]],[["1583"],["672"]],[["997"],["328"]],[["2"],["1"]],[["1987"],["660"]],[["1993"],["656"]],[["1997"],["996"]],[["1999"],["648"]],[["1297"],["432"]],[["163"],["54"]],[["1259"],["576"]],[["821"],["320"]],[["29"],["12"]],[["43"],["12"]],[["1949"],["972"]],[["1879"],["624"]],[["1759"],["584"]],[["1597"],["432"]],[["1619"],["808"]],[["1277"],["560"]],[["1097"],["544"]],[["953"],["384"]],[["751"],["200"]],[["607"],["200"]],[["509"],["252"]],[["431"],["168"]],[["317"],["156"]],[["211"],["48"]],[["127"],["36"]],[["101"],["40"]],[["31"],["8"]]]}}