Dataset Viewer
data_source
stringclasses 3
values | prompt
listlengths 1
1
| ability
stringclasses 1
value | reward_model
dict | extra_info
dict |
---|---|---|---|---|
taco
|
[
{
"content": "Solve the following problem using Python.\n\nGena loves sequences of numbers. Recently, he has discovered a new type of sequences which he called an almost arithmetical progression. A sequence is an almost arithmetical progression, if its elements can be represented as:\n\n * a1 = p, where p is some integer; \n * ai = ai - 1 + ( - 1)i + 1·q (i > 1), where q is some integer. \n\n\n\nRight now Gena has a piece of paper with sequence b, consisting of n integers. Help Gena, find there the longest subsequence of integers that is an almost arithmetical progression.\n\nSequence s1, s2, ..., sk is a subsequence of sequence b1, b2, ..., bn, if there is such increasing sequence of indexes i1, i2, ..., ik (1 ≤ i1 < i2 < ... < ik ≤ n), that bij = sj. In other words, sequence s can be obtained from b by crossing out some elements.\n\nInput\n\nThe first line contains integer n (1 ≤ n ≤ 4000). The next line contains n integers b1, b2, ..., bn (1 ≤ bi ≤ 106).\n\nOutput\n\nPrint a single integer — the length of the required longest subsequence.\n\nExamples\n\nInput\n\n2\n3 5\n\n\nOutput\n\n2\n\n\nInput\n\n4\n10 20 10 30\n\n\nOutput\n\n3\n\nNote\n\nIn the first test the sequence actually is the suitable subsequence. \n\nIn the second test the following subsequence fits: 10, 20, 10.",
"role": "user"
}
] |
code
|
{
"ground_truth": "{\"inputs\": [\"8\\n2 2 5 3 4 3 3 2\\n\", \"5\\n4 4 3 5 1\\n\", \"2\\n468 335\\n\", \"6\\n2 3 2 2 1 3\\n\", \"5\\n479 359 963 465 706\\n\", \"49\\n516 161 416 850 361 861 833 233 281 798 225 771 841 111 481 617 463 305 743 945 833 141 70 617 511 522 840 505 753 544 931 213 626 567 137 687 221 942 951 881 617 129 761 225 849 915 96 801 164\\n\", \"8\\n437 392 605 903 154 293 383 422\\n\", \"6\\n282 828 962 492 996 943\\n\", \"42\\n68 35 1 70 25 79 59 63 65 6 46 82 28 62 92 96 43 28 37 92 5 3 54 93 83 22 17 19 96 48 27 72 39 70 13 68 100 36 95 4 12 23\\n\", \"1\\n170\\n\", \"73\\n531 626 701 57 708 511 54 441 297 697 411 253 397 652 21 59 851 561 539 461 629 894 275 417 127 505 433 243 963 247 5 368 969 541 408 485 319 117 441 131 265 357 1 659 267 983 643 285 913 782 813 569 99 781 297 636 645 341 6 17 601 129 509 197 226 105 241 737 86 128 762 647 849\\n\", \"8\\n2 2 5 3 1 3 3 2\\n\", \"5\\n4 4 3 9 1\\n\", \"49\\n516 161 416 850 361 861 833 233 281 798 225 771 841 111 481 617 115 305 743 945 833 141 70 617 511 522 840 505 753 544 931 213 626 567 137 687 221 942 951 881 617 129 761 225 849 915 96 801 164\\n\", \"1\\n331\\n\", \"2\\n468 443\\n\", \"6\\n2 3 2 2 1 5\\n\", \"5\\n479 359 963 79 706\\n\", \"8\\n437 392 540 903 154 293 383 422\\n\", \"6\\n282 828 127 492 996 943\\n\", \"42\\n89 35 1 70 25 79 59 63 65 6 46 82 28 62 92 96 43 28 37 92 5 3 54 93 83 22 17 19 96 48 27 72 39 70 13 68 100 36 95 4 12 23\\n\", \"73\\n531 626 701 57 708 511 54 441 297 697 411 253 397 652 21 59 851 561 539 461 629 894 275 417 127 960 433 243 963 247 5 368 969 541 408 485 319 117 441 131 265 357 1 659 267 983 643 285 913 782 813 569 99 781 297 636 645 341 6 17 601 129 509 197 226 105 241 737 86 128 762 647 849\\n\", \"2\\n3 0\\n\", \"4\\n10 20 10 21\\n\", \"8\\n2 2 5 3 1 3 2 2\\n\", \"5\\n4 4 0 9 1\\n\", \"2\\n317 443\\n\", \"6\\n4 3 2 2 1 5\\n\", \"5\\n479 359 963 52 706\\n\", \"49\\n516 161 416 850 361 861 833 233 281 798 225 771 841 111 481 617 152 305 743 945 833 141 70 617 511 522 840 505 753 544 931 213 626 567 137 687 221 942 951 881 617 129 761 225 849 915 96 801 164\\n\", \"8\\n437 392 540 903 154 293 670 422\\n\", \"6\\n282 828 103 492 996 943\\n\", \"42\\n89 35 1 70 25 79 59 63 65 6 46 82 28 62 92 96 43 28 37 92 5 3 54 93 83 22 17 19 96 48 27 72 45 70 13 68 100 36 95 4 12 23\\n\", \"1\\n63\\n\", \"73\\n531 626 701 57 708 511 54 441 297 697 411 253 397 652 21 59 851 561 539 461 629 894 275 417 127 960 433 243 963 247 5 368 969 541 408 485 319 117 441 62 265 357 1 659 267 983 643 285 913 782 813 569 99 781 297 636 645 341 6 17 601 129 509 197 226 105 241 737 86 128 762 647 849\\n\", \"2\\n2 0\\n\", \"4\\n11 20 10 21\\n\", \"8\\n2 2 5 3 1 1 2 2\\n\", \"5\\n4 4 1 9 1\\n\", \"2\\n589 443\\n\", \"6\\n5 3 2 2 1 5\\n\", \"5\\n479 359 714 52 706\\n\", \"49\\n516 161 416 850 361 861 833 233 281 798 225 771 841 111 481 617 152 305 743 945 833 141 70 617 511 522 840 505 753 544 931 213 626 567 137 687 66 942 951 881 617 129 761 225 849 915 96 801 164\\n\", \"8\\n437 392 540 903 154 293 195 422\\n\", \"6\\n300 828 103 492 996 943\\n\", \"42\\n89 35 1 70 25 79 59 63 65 6 46 82 28 62 92 96 43 28 37 92 5 3 54 93 89 22 17 19 96 48 27 72 45 70 13 68 100 36 95 4 12 23\\n\", \"1\\n120\\n\", \"73\\n531 626 701 57 708 511 54 441 297 697 411 253 397 652 21 59 851 561 539 461 629 887 275 417 127 960 433 243 963 247 5 368 969 541 408 485 319 117 441 62 265 357 1 659 267 983 643 285 913 782 813 569 99 781 297 636 645 341 6 17 601 129 509 197 226 105 241 737 86 128 762 647 849\\n\", \"4\\n19 20 10 21\\n\", \"8\\n2 2 5 6 1 1 2 2\\n\", \"5\\n4 4 2 9 1\\n\", \"2\\n7 443\\n\", \"5\\n479 359 714 52 1222\\n\", \"49\\n516 161 416 850 361 861 833 233 281 798 225 771 841 111 481 617 152 305 743 945 833 141 70 617 511 522 840 505 753 544 931 213 626 567 137 687 66 942 951 881 617 129 761 225 849 915 182 801 164\\n\", \"8\\n437 392 540 903 154 182 195 422\\n\", \"6\\n300 828 103 492 996 1194\\n\", \"42\\n89 35 1 70 25 79 59 63 65 6 46 82 28 62 92 96 43 28 37 92 5 3 54 93 89 22 17 19 96 48 4 72 45 70 13 68 100 36 95 4 12 23\\n\", \"1\\n68\\n\", \"73\\n531 626 701 57 708 511 54 441 297 109 411 253 397 652 21 59 851 561 539 461 629 887 275 417 127 960 433 243 963 247 5 368 969 541 408 485 319 117 441 62 265 357 1 659 267 983 643 285 913 782 813 569 99 781 297 636 645 341 6 17 601 129 509 197 226 105 241 737 86 128 762 647 849\\n\", \"4\\n19 9 10 21\\n\", \"8\\n2 2 5 6 1 1 2 3\\n\", \"5\\n4 7 2 9 1\\n\", \"2\\n7 611\\n\", \"5\\n688 359 714 52 1222\\n\", \"49\\n516 161 416 850 361 861 833 233 281 798 225 771 841 111 481 617 152 305 743 945 833 141 70 617 511 522 840 505 753 544 931 213 179 567 137 687 66 942 951 881 617 129 761 225 849 915 182 801 164\\n\", \"8\\n437 392 757 903 154 182 195 422\\n\", \"6\\n300 828 103 492 1487 1194\\n\", \"42\\n89 35 1 70 25 79 59 63 65 6 46 82 28 62 92 96 43 28 37 92 5 3 54 93 89 10 17 19 96 48 4 72 45 70 13 68 100 36 95 4 12 23\\n\", \"1\\n116\\n\", \"73\\n531 1117 701 57 708 511 54 441 297 109 411 253 397 652 21 59 851 561 539 461 629 887 275 417 127 960 433 243 963 247 5 368 969 541 408 485 319 117 441 62 265 357 1 659 267 983 643 285 913 782 813 569 99 781 297 636 645 341 6 17 601 129 509 197 226 105 241 737 86 128 762 647 849\\n\", \"4\\n12 9 10 21\\n\", \"8\\n4 2 5 6 1 1 2 3\\n\", \"5\\n4 7 3 9 1\\n\", \"2\\n7 484\\n\", \"5\\n688 359 714 61 1222\\n\", \"49\\n516 161 416 850 361 861 833 233 281 798 225 771 841 111 481 16 152 305 743 945 833 141 70 617 511 522 840 505 753 544 931 213 179 567 137 687 66 942 951 881 617 129 761 225 849 915 182 801 164\\n\", \"8\\n437 392 757 903 7 182 195 422\\n\", \"6\\n300 828 103 492 1487 1484\\n\", \"42\\n167 35 1 70 25 79 59 63 65 6 46 82 28 62 92 96 43 28 37 92 5 3 54 93 89 10 17 19 96 48 4 72 45 70 13 68 100 36 95 4 12 23\\n\", \"2\\n3 5\\n\", \"4\\n10 20 10 30\\n\"], \"outputs\": [\"3\", \"2\", \"2\", \"4\", \"2\", \"4\", \"2\", \"2\", \"4\", \"1\", \"4\", \"3\\n\", \"2\\n\", \"4\\n\", \"1\\n\", \"2\\n\", \"3\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"4\\n\", \"4\\n\", \"2\\n\", \"3\\n\", \"4\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"4\\n\", \"2\\n\", \"2\\n\", \"4\\n\", \"1\\n\", \"4\\n\", \"2\\n\", \"2\\n\", \"4\\n\", \"3\\n\", \"2\\n\", \"3\\n\", \"2\\n\", \"4\\n\", \"2\\n\", \"2\\n\", \"4\\n\", \"1\\n\", \"4\\n\", \"2\\n\", \"4\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"4\\n\", \"2\\n\", \"2\\n\", \"4\\n\", \"1\\n\", \"4\\n\", \"2\\n\", \"3\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"4\\n\", \"2\\n\", \"2\\n\", \"4\\n\", \"1\\n\", \"4\\n\", \"2\\n\", \"3\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"4\\n\", \"2\\n\", \"2\\n\", \"4\\n\", \"2\", \"3\"]}",
"style": "rule"
}
|
{
"index": 4908,
"reference": null,
"split": "train"
}
|
primeintellect
|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a matrix of size $n \\times n$ filled with lowercase English letters. You can change no more than $k$ letters in this matrix.\n\nConsider all paths from the upper left corner to the lower right corner that move from a cell to its neighboring cell to the right or down. Each path is associated with the string that is formed by all the letters in the cells the path visits. Thus, the length of each string is $2n - 1$.\n\nFind the lexicographically smallest string that can be associated with a path after changing letters in at most $k$ cells of the matrix.\n\nA string $a$ is lexicographically smaller than a string $b$, if the first different letter in $a$ and $b$ is smaller in $a$.\n\n\n-----Input-----\n\nThe first line contains two integers $n$ and $k$ ($1 \\le n \\le 2000$, $0 \\le k \\le n^2$) — the size of the matrix and the number of letters you can change.\n\nEach of the next $n$ lines contains a string of $n$ lowercase English letters denoting one row of the matrix.\n\n\n-----Output-----\n\nOutput the lexicographically smallest string that can be associated with some valid path after changing no more than $k$ letters in the matrix.\n\n\n-----Examples-----\nInput\n4 2\nabcd\nbcde\nbcad\nbcde\n\nOutput\naaabcde\n\nInput\n5 3\nbwwwz\nhrhdh\nsepsp\nsqfaf\najbvw\n\nOutput\naaaepfafw\n\nInput\n7 6\nypnxnnp\npnxonpm\nnxanpou\nxnnpmud\nnhtdudu\nnpmuduh\npmutsnz\n\nOutput\naaaaaaadudsnz\n\n\n\n-----Note-----\n\nIn the first sample test case it is possible to change letters 'b' in cells $(2, 1)$ and $(3, 1)$ to 'a', then the minimum path contains cells $(1, 1), (2, 1), (3, 1), (4, 1), (4, 2), (4, 3), (4, 4)$. The first coordinate corresponds to the row and the second coordinate corresponds to the column.\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solve the problem and return the code.",
"role": "user"
}
] |
code
|
{
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 2\\nabcd\\nbcde\\nbcad\\nbcde\\n\", \"output\": \"aaabcde\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 3\\nbwwwz\\nhrhdh\\nsepsp\\nsqfaf\\najbvw\\n\", \"output\": \"aaaepfafw\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 6\\nypnxnnp\\npnxonpm\\nnxanpou\\nxnnpmud\\nnhtdudu\\nnpmuduh\\npmutsnz\\n\", \"output\": \"aaaaaaadudsnz\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 0\\ng\\n\", \"output\": \"g\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1\\ng\\n\", \"output\": \"a\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 0\\na\\n\", \"output\": \"a\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1\\nz\\n\", \"output\": \"a\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 16\\ndfhs\\nvgca\\ndfgd\\nvscd\\n\", \"output\": \"aaaaaaa\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 0\\nz\\n\", \"output\": \"z\\n\"}]",
"style": "rule"
}
|
{
"index": 1829,
"reference": null,
"split": "train"
}
|
primeintellect
|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOnce Bob took a paper stripe of n squares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negative. He became interested in how many ways exist to cut this stripe into two pieces so that the sum of numbers from one piece is equal to the sum of numbers from the other piece, and each piece contains positive integer amount of squares. Would you help Bob solve this problem?\n\nInput\n\nThe first input line contains integer n (1 ≤ n ≤ 105) — amount of squares in the stripe. The second line contains n space-separated numbers — they are the numbers written in the squares of the stripe. These numbers are integer and do not exceed 10000 in absolute value.\n\nOutput\n\nOutput the amount of ways to cut the stripe into two non-empty pieces so that the sum of numbers from one piece is equal to the sum of numbers from the other piece. Don't forget that it's allowed to cut the stripe along the squares' borders only.\n\nExamples\n\nInput\n\n9\n1 5 -6 7 9 -16 0 -2 2\n\n\nOutput\n\n3\n\n\nInput\n\n3\n1 1 1\n\n\nOutput\n\n0\n\n\nInput\n\n2\n0 0\n\n\nOutput\n\n1\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solve the problem and return the code.",
"role": "user"
}
] |
code
|
{
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6\\n2 3 -3 0 -3 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n1 2 3 3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n-1 5 2 3 1 5 0 2 2 5\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n0 0 0\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n-3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 0 0 0 0 0 0 0 0 0\\n\", \"output\": \"9\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n-2 3 3 2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n-2 -1 1 0 -2 -1 2 2 0 0 2 1 0 2 0 2 1 0 -1 -1 -1 0 -2 -1 2 -1 -2 2 -2 2 -2 -2 2 1 1 1 -2 2 0 0 2 -1 2 2 2 0 -1 -1 -1 1 -2 2 2 2 -2 0 0 -2 0 -2 -2 0 -1 -1 -2 -1 1 2 -2 -1 1 -2 -1 0 -2 2 2 -1 -2 2 0 0 0 1 0 1 2 1 -2 -2 -1 -1 -2 -2 -2 -1 2 2 2 -2\\n\", \"output\": \"6\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n-6 3 -1 2 -7\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\n-5 -2 1 1 5 0 -4 4 0\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15\\n0 4 0 3 -1 4 -2 -2 -4 -4 3 2 4 -1 -3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n-10000\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n3 -1 -3 -1 3 -2 0 3 1 -2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 -1 2 2 -1 1 0 0 0 2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 4 -3 0 -2 2 -3 -3 2 5\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"50\\n-4 -3 3 4 -1 0 2 -4 -3 -4 1 4 3 0 4 1 0 -3 4 -3 -2 2 2 1 0 -4 -4 -5 3 2 -1 4 5 -3 -3 4 4 -5 2 -3 4 -5 2 5 -4 4 1 -2 -4 3\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 2 3 4 5\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n100 1 10 111\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n2 7 6 0 8 -2 0 1 8 -1 7 -4 -1 1 0 3 4 -4 3 7 8 -4 -6 6 4 -2 -5 7 4 6 1 6 3 8 -2 6 -6 -3 0 -1 -7 -8 -2 5 8 6 -2 -2 -5 -4 -7 -3 -5 -3 -3 -1 5 8 4 0 -7 -6 8 -4 -1 7 2 6 6 4 -5 -4 -5 -2 2 -2 -7 -1 5 -8 -6 -2 -5 4 2 8 -6 7 -8 -1 -5 8 6 -3 -1 7 -1 2 -8 -8\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n2 0 0 2 -1 3 4 5\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n-4 2 4 4 1 3 -3 -3 2 1 -4 0 0 2 3 -1 -4 -3 4 -2 -3 -3 -3 -1 -2 -3 -1 -4 0 4 0 -1 4 0 -4 -4 4 -4 -2 1 -4 1 -3 -2 3 -4 4 0 -1 3 -1 4 -1 4 -1 3 -3 -3 -2 -2 4 -3 -3 4 -3 -2 -1 0 -2 4 0 -3 -1 -2 -3 1 -4 1 -3 -3 -3 -2 -3 0 1 -2 -2 -4 -3 -1 2 3 -1 1 1 0 3 -3 -1 -2\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n-1 1 -3 4 3 0 2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n3 0 -5 2 -3 -1 -1 0 -2 -5 -4 2 1 2 -2 -1 -1 -4 3 -1 -3 -1 5 0 -4 -4 -1 0 -2 -2 0 1 -1 -2 -1 -5 -4 -2 3 1 -3 0 -1 1 0 -1 2 0 -2 -1 -3 1 -2 2 3 2 -3 -5 2 2 -2 -2 1 2 -2 -1 3 0 -4 7 -2 2 1 4 -9 -1 -2 -1 0 -1 0 -2 -2 -1 1 1 -4 2 -3 -3 7 1 1 -3 -7 0 -2 0 5 -2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n-1 -1 1 -1 0 1 0 1 1 1\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n10000\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n2 3 -3 -1 -3 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n-7 3 -1 2 -7\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 0 0 0 0 1 0 1 0 0\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n-2 -1 1 0 -2 -1 2 2 0 0 2 1 0 2 0 2 1 0 -1 -1 -1 0 -2 -1 2 -1 -2 2 -2 2 -2 -2 2 1 1 1 -2 2 0 0 2 -1 2 2 2 0 -1 -1 -1 1 -2 2 2 2 -2 0 0 -2 0 -2 -2 0 -1 -1 -2 -1 1 2 -2 -1 1 -2 -1 0 -2 2 2 -1 -2 2 0 0 0 1 1 1 2 1 -2 -2 -1 -1 -2 -2 -2 -1 2 2 2 -1\\n\", \"output\": \"11\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 -1 2 2 -1 2 0 0 0 4\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\n0 5 -4 7 9 -16 0 -1 2\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 1 0 0 0 1 -1 1 0 0\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n-2 -1 1 0 -2 -1 2 1 0 0 2 1 0 2 0 2 1 0 -1 -1 -1 0 -2 -1 2 -1 -2 2 -2 2 -2 -2 2 1 1 1 -2 2 0 0 2 -1 2 3 2 0 -1 -1 -1 1 -2 2 2 2 -2 0 0 -2 0 -2 -2 0 -1 -1 -2 -1 1 2 -2 -1 1 -2 -1 0 -2 2 2 -1 -2 2 0 0 0 1 1 1 2 1 -2 -2 -1 -1 -2 -2 -2 -1 2 2 2 -1\\n\", \"output\": \"13\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n1 2 4 3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n-1 5 2 3 1 5 0 2 2 7\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n-1 0 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n-4\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 0 0 0 0 0 0 1 0 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n-2 3 3 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n-2 -1 1 0 -2 -1 2 2 0 0 2 1 0 2 0 2 1 0 -1 -1 -1 0 -2 -1 2 -1 -2 2 -2 2 -2 -2 2 1 1 1 -2 2 0 0 2 -1 2 2 2 0 -1 -1 -1 1 -2 2 2 2 -2 0 0 -2 0 -2 -2 0 -1 -1 -2 -1 1 2 -2 -1 1 -2 -1 0 -2 2 2 -1 -2 2 0 0 0 1 1 1 2 1 -2 -2 -1 -1 -2 -2 -2 -1 2 2 2 -2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\n-5 -2 1 1 5 0 -4 7 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15\\n0 4 0 4 -1 4 -2 -2 -4 -4 3 2 4 -1 -3\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n-9156\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n3 -1 -3 -1 3 -2 0 3 0 -2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 -1 2 2 -1 2 0 0 0 2\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 4 -3 0 -2 4 -3 -3 2 5\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"50\\n-4 -3 3 4 -1 0 2 -4 -3 -4 1 4 3 0 4 1 0 -3 4 -3 -2 2 2 1 0 -4 -4 -5 3 2 -1 1 5 -3 -3 4 4 -5 2 -3 4 -5 2 5 -4 4 1 -2 -4 3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 2 3 4 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n100 1 10 110\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n2 7 6 0 8 -2 0 1 8 -1 7 -4 -1 1 0 3 4 -4 3 7 8 -4 -6 6 4 -2 -5 7 4 6 1 6 3 8 -2 6 -6 -3 0 -1 -7 -8 -2 5 8 6 -2 -2 -5 -4 -7 -3 -5 -5 -3 -1 5 8 4 0 -7 -6 8 -4 -1 7 2 6 6 4 -5 -4 -5 -2 2 -2 -7 -1 5 -8 -6 -2 -5 4 2 8 -6 7 -8 -1 -5 8 6 -3 -1 7 -1 2 -8 -8\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n2 0 0 1 -1 3 4 5\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n-4 2 4 4 1 3 -3 -3 2 1 -4 0 0 2 3 -1 -4 -3 4 -2 -3 -3 -3 -1 -2 -3 -1 -4 0 4 0 -1 4 0 -4 -4 4 -4 -2 1 -4 1 -3 -2 3 -4 4 0 -1 3 -1 4 -1 4 -1 3 -3 -3 -2 -2 4 -3 -3 4 -2 -2 -1 0 -2 4 0 -3 -1 -2 -3 1 -4 1 -3 -3 -3 -2 -3 0 1 -2 -2 -4 -3 -1 2 3 -1 1 1 0 3 -3 -1 -2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n-1 1 -3 4 3 0 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n3 0 -5 2 -3 -1 -1 0 -2 -5 -4 2 1 2 -2 -1 -1 -4 3 -1 -3 -1 5 0 -4 -4 -1 0 -2 -2 0 0 -1 -2 -1 -5 -4 -2 3 1 -3 0 -1 1 0 -1 2 0 -2 -1 -3 1 -2 2 3 2 -3 -5 2 2 -2 -2 1 2 -2 -1 3 0 -4 7 -2 2 1 4 -9 -1 -2 -1 0 -1 0 -2 -2 -1 1 1 -4 2 -3 -3 7 1 1 -3 -7 0 -2 0 5 -2\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n-1 -1 1 -1 0 1 0 1 1 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n11000\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n1 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 1 2\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\n0 5 -6 7 9 -16 0 -2 2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n2 3 -3 -1 -3 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n0 2 4 3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n-1 5 2 3 1 10 0 2 2 7\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n-1 1 0\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n-6\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n-4 3 3 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n-7 3 -1 2 -10\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\n-5 -2 1 1 0 0 -4 7 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15\\n-1 4 0 4 -1 4 -2 -2 -4 -4 3 2 4 -1 -3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n-6684\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n3 -1 -3 -1 3 -2 0 4 0 -2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 4 -3 0 -2 4 -3 -3 2 3\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"50\\n-4 -3 3 4 -1 0 2 -4 -3 -4 1 4 3 0 4 2 0 -3 4 -3 -2 2 2 1 0 -4 -4 -5 3 2 -1 1 5 -3 -3 4 4 -5 2 -3 4 -5 2 5 -4 4 1 -2 -4 3\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 0 3 4 0\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n100 1 10 011\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n2 7 6 0 8 -2 0 1 8 -1 7 -4 -1 1 0 3 4 -4 3 7 8 -4 -6 6 4 -2 -5 7 4 6 1 6 3 8 -2 6 -6 -3 0 -1 -7 -8 -2 5 8 6 -2 -2 -5 -4 -7 -3 -5 -5 -3 -1 5 8 4 0 -7 -6 8 -4 -1 7 2 6 6 4 -5 -4 -5 -2 2 -2 -7 -1 5 -8 -6 -2 -5 4 2 8 -6 7 -8 -1 -5 8 6 -3 -1 7 -1 2 -11 -8\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n2 0 0 1 -1 4 4 5\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n-4 2 4 4 1 3 -3 -3 2 1 -4 0 0 2 3 -1 -4 -3 4 -2 -3 -3 -3 -1 -2 -3 -1 -4 0 4 0 -1 4 0 -4 -4 4 -4 -2 1 -4 1 -3 -2 3 -4 4 0 -1 3 -1 4 -1 4 -1 3 -3 -3 -2 -2 4 -3 -3 4 -2 -2 -1 0 -2 1 0 -3 -1 -2 -3 1 -4 1 -3 -3 -3 -2 -3 0 1 -2 -2 -4 -3 -1 2 3 -1 1 1 0 3 -3 -1 -2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n-1 1 -2 4 3 0 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n3 0 -5 2 -3 -1 -1 0 -2 -5 -4 2 1 2 -2 -1 -1 -4 3 -1 -3 -1 5 0 -4 -4 -1 0 -2 -2 0 0 -1 -2 -1 -5 -4 -2 3 1 -3 0 -1 1 0 -1 2 0 -2 -1 -3 1 -1 2 3 2 -3 -5 2 2 -2 -2 1 2 -2 -1 3 0 -4 7 -2 2 1 4 -9 -1 -2 -1 0 -1 0 -2 -2 -1 1 1 -4 2 -3 -3 7 1 1 -3 -7 0 -2 0 5 -2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n-1 -1 0 -1 0 1 0 1 1 0\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n01000\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n0 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 0 2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\n0 5 -6 7 9 -16 0 -1 2\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n2 2 -3 -1 -3 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n0 2 5 3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n-1 5 2 3 1 2 0 2 2 7\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n-2 0 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n-8\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 0 0 0 0 1 -1 1 0 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n-4 2 3 1\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n-2 -1 1 0 -2 -1 2 2 0 0 2 1 0 2 0 2 1 0 -1 -1 -1 0 -2 -1 2 -1 -2 2 -2 2 -2 -2 2 1 1 1 -2 2 0 0 2 -1 2 3 2 0 -1 -1 -1 1 -2 2 2 2 -2 0 0 -2 0 -2 -2 0 -1 -1 -2 -1 1 2 -2 -1 1 -2 -1 0 -2 2 2 -1 -2 2 0 0 0 1 1 1 2 1 -2 -2 -1 -1 -2 -2 -2 -1 2 2 2 -1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n-7 3 -1 2 -14\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\n-5 -2 1 1 0 -1 -4 7 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15\\n-1 4 0 4 -1 4 -2 0 -4 -4 3 2 4 -1 -3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n-8041\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n3 -1 -3 -1 1 -2 0 4 0 -2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 -1 2 2 -1 2 0 1 0 4\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0 4 -3 0 -2 4 -2 -3 2 3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"50\\n-4 -3 3 4 -1 0 2 -4 -3 -4 1 4 3 0 4 2 0 -3 8 -3 -2 2 2 1 0 -4 -4 -5 3 2 -1 1 5 -3 -3 4 4 -5 2 -3 4 -5 2 5 -4 4 1 -2 -4 3\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 0 6 4 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n100 1 10 001\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n2 7 6 0 8 -2 0 1 8 -1 7 -4 -1 1 0 3 4 -4 3 7 8 -4 -6 6 4 -2 -5 7 4 6 1 6 3 8 -2 6 -6 -3 0 -1 -7 -8 -2 5 8 6 -2 -2 -5 -4 -7 -3 -5 -5 -1 -1 5 8 4 0 -7 -6 8 -4 -1 7 2 6 6 4 -5 -4 -5 -2 2 -2 -7 -1 5 -8 -6 -2 -5 4 2 8 -6 7 -8 -1 -5 8 6 -3 -1 7 -1 2 -11 -8\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n2 0 1 1 -1 4 4 5\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n-4 2 4 4 1 3 -3 -3 2 1 -4 0 0 2 3 -1 -4 -3 4 -2 -3 -3 -3 -1 -2 -3 -1 -4 0 4 0 -1 4 0 -4 -4 4 -4 -2 1 -4 1 -3 -2 3 -4 4 0 -1 3 -1 4 -1 4 -1 3 -2 -3 -2 -2 4 -3 -3 4 -2 -2 -1 0 -2 1 0 -3 -1 -2 -3 1 -4 1 -3 -3 -3 -2 -3 0 1 -2 -2 -4 -3 -1 2 3 -1 1 1 0 3 -3 -1 -2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n-1 1 -2 4 4 0 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n3 0 -5 2 -3 -1 -1 0 -2 -5 -4 2 1 2 -2 -1 -1 -4 3 -1 -3 -1 5 0 -4 -4 -1 0 -2 -2 0 0 -1 -2 -1 -5 -4 -2 3 1 -3 0 -1 1 0 -1 2 0 -2 -1 -3 1 -1 2 3 2 -3 -5 2 2 -2 -2 1 2 -2 -1 3 0 -4 7 -2 2 1 4 -9 -1 -2 -1 0 -1 0 -2 -2 -1 1 1 -4 1 -3 -3 7 1 1 -3 -7 0 -2 0 5 -2\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n-1 -1 0 -1 0 1 -1 1 1 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n01001\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n-1 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n0 0 2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n2 4 -3 -1 -3 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n0 2 6 3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n-1 5 2 3 1 3 0 2 2 7\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n-3 0 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n-11\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n-4 2 5 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n-7 2 -1 2 -14\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\n-5 -2 1 1 0 -1 -4 7 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n4\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15\\n-1 5 0 4 -1 4 -2 0 -4 -4 3 2 4 -1 -3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n-13269\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n0 0\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 1 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\n1 5 -6 7 9 -16 0 -2 2\\n\", \"output\": \"3\\n\"}]",
"style": "rule"
}
|
{
"index": 14245,
"reference": null,
"split": "train"
}
|
primeintellect
|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing some positive integer. After clicking the red button, device multiplies the displayed number by two. After clicking the blue button, device subtracts one from the number on the display. If at some point the number stops being positive, the device breaks down. The display can show arbitrarily large numbers. Initially, the display shows number n.\n\nBob wants to get number m on the display. What minimum number of clicks he has to make in order to achieve this result?\n\n\n-----Input-----\n\nThe first and the only line of the input contains two distinct integers n and m (1 ≤ n, m ≤ 10^4), separated by a space .\n\n\n-----Output-----\n\nPrint a single number — the minimum number of times one needs to push the button required to get the number m out of number n.\n\n\n-----Examples-----\nInput\n4 6\n\nOutput\n2\n\nInput\n10 1\n\nOutput\n9\n\n\n\n-----Note-----\n\nIn the first example you need to push the blue button once, and then push the red button once.\n\nIn the second example, doubling the number is unnecessary, so we need to push the blue button nine times.\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solve the problem and return the code.",
"role": "user"
}
] |
code
|
{
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 6\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 1\\n\", \"output\": \"9\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 2\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 1\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 3\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 1\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 10\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100 99\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"99 100\\n\", \"output\": \"50\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 17\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"666 6666\\n\", \"output\": \"255\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6666 666\\n\", \"output\": \"6000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 8192\\n\", \"output\": \"13\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 8193\\n\", \"output\": \"27\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9999 10000\\n\", \"output\": \"5000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10000 9999\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10000 1\\n\", \"output\": \"9999\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1234 5678\\n\", \"output\": \"528\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9102 9103\\n\", \"output\": \"4552\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8192 1\\n\", \"output\": \"8191\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9912 1023\\n\", \"output\": \"8889\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100 500\\n\", \"output\": \"41\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9997 9999\\n\", \"output\": \"4999\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5000 10000\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4000 7997\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 10000\\n\", \"output\": \"20\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 8191\\n\", \"output\": \"14\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9999 10000\\n\", \"output\": \"5000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9097 9998\\n\", \"output\": \"4099\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"886 9383\\n\", \"output\": \"305\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 9\\n\", \"output\": \"7\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1918 10000\\n\", \"output\": \"671\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 3\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 4\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 10000\\n\", \"output\": \"19\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 10000\\n\", \"output\": \"17\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 10000\\n\", \"output\": \"18\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9998 10000\\n\", \"output\": \"4999\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5000 10000\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5001 10000\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10000 1\\n\", \"output\": \"9999\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 9999\\n\", \"output\": \"21\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7777 9999\\n\", \"output\": \"2779\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 100\\n\", \"output\": \"9\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 8722\\n\", \"output\": \"18\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"848 4561\\n\", \"output\": \"283\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9967 9973\\n\", \"output\": \"4982\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5555 10000\\n\", \"output\": \"556\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"999 10000\\n\", \"output\": \"378\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 6\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9 38\\n\", \"output\": \"8\\n\"}]",
"style": "rule"
}
|
{
"index": 540,
"reference": null,
"split": "train"
}
|
primeintellect
|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Republic of AtCoder, Snuke Chameleons (Family: Chamaeleonidae, Genus: Bartaberia) are very popular pets. Ringo keeps N Snuke Chameleons in a cage.\n\nA Snuke Chameleon that has not eaten anything is blue. It changes its color according to the following rules:\n\n* A Snuke Chameleon that is blue will change its color to red when the number of red balls it has eaten becomes strictly larger than the number of blue balls it has eaten.\n* A Snuke Chameleon that is red will change its color to blue when the number of blue balls it has eaten becomes strictly larger than the number of red balls it has eaten.\n\n\n\nInitially, every Snuke Chameleon had not eaten anything. Ringo fed them by repeating the following process K times:\n\n* Grab either a red ball or a blue ball.\n* Throw that ball into the cage. Then, one of the chameleons eats it.\n\n\n\nAfter Ringo threw in K balls, all the chameleons were red. We are interested in the possible ways Ringo could have thrown in K balls. How many such ways are there? Find the count modulo 998244353. Here, two ways to throw in balls are considered different when there exists i such that the color of the ball that are thrown in the i-th throw is different.\n\nConstraints\n\n* 1 \\leq N,K \\leq 5 \\times 10^5\n* N and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n\nN K\n\n\nOutput\n\nPrint the possible ways Ringo could have thrown in K balls, modulo 998244353.\n\nExamples\n\nInput\n\n2 4\n\n\nOutput\n\n7\n\n\nInput\n\n3 7\n\n\nOutput\n\n57\n\n\nInput\n\n8 3\n\n\nOutput\n\n0\n\n\nInput\n\n8 10\n\n\nOutput\n\n46\n\n\nInput\n\n123456 234567\n\n\nOutput\n\n857617983\n\nThe input will be given via stdin and the output should be printed to stdout by your code.\n\nNow solve the problem by providing the code.",
"role": "user"
}
] |
code
|
{
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"8 10\", \"output\": \"46\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 7\", \"output\": \"57\"}, {\"type\": \"stdin_stdout\", \"input\": \"123456 234567\", \"output\": \"857617983\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 3\", \"output\": \"0\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 4\", \"output\": \"7\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 5\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 7\", \"output\": \"64\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"25732 234567\", \"output\": \"80550073\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 5\", \"output\": \"16\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 4\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 11\", \"output\": \"1024\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"29001 234567\", \"output\": \"246712986\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 7\", \"output\": \"42\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 5\", \"output\": \"15\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 8\", \"output\": \"99\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 5\", \"output\": \"11\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 12\", \"output\": \"1981\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 6\", \"output\": \"26\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 18\", \"output\": \"130918\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 10\", \"output\": \"130\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 13\", \"output\": \"4017\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 7\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 15\", \"output\": \"16278\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 17\", \"output\": \"65399\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 17\", \"output\": \"58651\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 21\", \"output\": \"1026876\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 21\", \"output\": \"784626\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 21\", \"output\": \"1048365\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 21\", \"output\": \"1048575\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 21\", \"output\": \"1048576\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 39\", \"output\": \"360709869\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 39\", \"output\": \"360709868\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 36\", \"output\": \"419430365\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 57\", \"output\": \"229805563\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 57\", \"output\": \"229805507\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 57\", \"output\": \"229803967\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 82\", \"output\": \"764024058\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 82\", \"output\": \"763938738\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 12\", \"output\": \"1816\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 21\", \"output\": \"1047225\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 26\", \"output\": \"33551806\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 26\", \"output\": \"33554432\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 13\", \"output\": \"4096\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 10\", \"output\": \"512\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 6\", \"output\": \"32\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9466 12435\", \"output\": \"402780851\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"12129 12435\", \"output\": \"497044792\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"20457 22802\", \"output\": \"659885777\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"19156 22802\", \"output\": \"506658120\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7791 22802\", \"output\": \"26668699\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7791 10349\", \"output\": \"223286655\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 11\", \"output\": \"176\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 14\", \"output\": \"8192\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"24197 234567\", \"output\": \"19172661\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 8\", \"output\": \"128\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"29001 137176\", \"output\": \"790285595\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 10\", \"output\": \"511\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 8\", \"output\": \"8\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 9\", \"output\": \"247\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 12\", \"output\": \"2047\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 18\", \"output\": \"131072\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 9\", \"output\": \"37\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 13\", \"output\": \"1586\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 30\", \"output\": \"536870476\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 17\", \"output\": \"65536\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 25\", \"output\": \"16721761\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 37\", \"output\": \"838417028\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 17\", \"output\": \"26333\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 35\", \"output\": \"184503247\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 41\", \"output\": \"444595122\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 22\", \"output\": \"2097152\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 53\", \"output\": \"263923935\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 39\", \"output\": \"360709127\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 50\", \"output\": \"32990491\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 48\", \"output\": \"8247622\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 77\", \"output\": \"398217411\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 34\", \"output\": \"603979206\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1542 4524\", \"output\": \"927727781\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 106\", \"output\": \"289143526\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 38\", \"output\": \"679476407\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 12\", \"output\": \"562\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15 21\", \"output\": \"60460\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 26\", \"output\": \"33554431\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9466 19307\", \"output\": \"15243692\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6009 12435\", \"output\": \"413109084\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"19156 20295\", \"output\": \"199900869\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10588 22802\", \"output\": \"791265091\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7791 21231\", \"output\": \"792746414\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7791 14009\", \"output\": \"669260580\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 11\", \"output\": \"848\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 9\", \"output\": \"93\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 3\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 9\", \"output\": \"256\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"18209 234567\", \"output\": \"750285457\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"24437 137176\", \"output\": \"159086230\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 9\", \"output\": \"9\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 12\", \"output\": \"2048\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 18\", \"output\": \"131071\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 10\", \"output\": \"466\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 9\", \"output\": \"219\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 5\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 32\", \"output\": \"150994942\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 18\", \"output\": \"121670\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 23\", \"output\": \"4194050\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 16\", \"output\": \"32768\\n\"}]",
"style": "rule"
}
|
{
"index": 7614,
"reference": null,
"split": "train"
}
|
primeintellect
|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor given two sequences $X$ and $Y$, a sequence $Z$ is a common subsequence of $X$ and $Y$ if $Z$ is a subsequence of both $X$ and $Y$. For example, if $X = \\\\{a,b,c,b,d,a,b\\\\}$ and $Y = \\\\{b,d,c,a,b,a\\\\}$, the sequence $\\\\{b,c,a\\\\}$ is a common subsequence of both $X$ and $Y$. On the other hand, the sequence $\\\\{b,c,a\\\\}$ is not a longest common subsequence (LCS) of $X$ and $Y$, since it has length 3 and the sequence $\\\\{b,c,b,a\\\\}$, which is also common to both $X$ and $Y$, has length 4. The sequence $\\\\{b,c,b,a\\\\}$ is an LCS of $X$ and $Y$, since there is no common subsequence of length 5 or greater.\n\nWrite a program which finds the length of LCS of given two sequences $X$ and $Y$. The sequence consists of alphabetical characters.\n\nConstraints\n\n* $1 \\leq q \\leq 150$\n* $1 \\leq$ length of $X$ and $Y$ $\\leq 1,000$\n* $q \\leq 20$ if the dataset includes a sequence whose length is more than 100\n\nInput\n\nThe input consists of multiple datasets. In the first line, an integer $q$ which is the number of datasets is given. In the following $2 \\times q$ lines, each dataset which consists of the two sequences $X$ and $Y$ are given.\n\nOutput\n\nFor each dataset, print the length of LCS of $X$ and $Y$ in a line.\n\nExample\n\nInput\n\n3\nabcbdab\nbdcaba\nabc\nabc\nabc\nbc\n\n\nOutput\n\n4\n3\n2\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solve the problem and return the code.",
"role": "user"
}
] |
code
|
{
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\nabcbdab\\nbdcaba\\nabc\\nabc\\nacb\\nbc\", \"output\": \"4\\n3\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nabcbdab\\nbdcaba\\nabc\\nabc\\nbcb\\nbc\", \"output\": \"4\\n3\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nabcbdab\\nbdcaba\\n`bc\\nabc\\nbcb\\nbc\", \"output\": \"4\\n2\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nbadbcba\\nbdcaba\\n`bc\\nabc\\nbcb\\nbc\", \"output\": \"5\\n2\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nbadbdba\\nbdcaba\\n`bc\\nabc\\nbcb\\ncc\", \"output\": \"4\\n2\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nbadbdba\\nbdcaba\\n`bc\\nabd\\nbcb\\ncc\", \"output\": \"4\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nbadbdba\\nabacdb\\n_cb\\ndba\\nbbb\\ncc\", \"output\": \"4\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdbdab\\nabacdb\\n_cb\\ndba\\nbbb\\ncb\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nab`cdb\\n_cb\\ndb`\\nbcb\\ncb\", \"output\": \"3\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad`b\\nbdc`ba\\nbc`\\ndc_\\nbbc\\nbc\", \"output\": \"4\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad_b\\nab`ccb\\nbc`\\nce^\\nbbc\\ncb\", \"output\": \"2\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`b_adcb\\n`baccb\\nacb\\nce_\\nbbd\\ncc\", \"output\": \"5\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab_adcb\\n`accab\\nacb\\nce_\\nbbd\\ncc\", \"output\": \"3\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab_adcb\\n`accab\\nabb\\nce_\\nbbd\\ncc\", \"output\": \"3\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\n`aaccb\\nabb\\n_ec\\ndab\\ncc\", \"output\": \"4\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab]adcb\\naacca_\\nacc\\ne_b\\nb`c\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab]adca\\naacca_\\nacc\\ne_b\\nb`c\\ncd\", \"output\": \"4\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nb`ec\\\\ca\\nc_acbc\\ncbb\\nb_f\\nea`\\ndb\", \"output\": \"2\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\na`ab\\\\ce\\nbcbb_c\\nabb\\nf_c\\n`ea\\ndc\", \"output\": \"2\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\na`ab\\\\ce\\ncccb_b\\ncaa\\nf`c\\n_af\\nec\", \"output\": \"1\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\na`ab\\\\ce\\ncccb_b\\ncaa\\nd`f\\n_af\\nec\", \"output\": \"1\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nc`ca\\\\bb\\n_aaccd\\nabc\\nbc^\\ng`]\\ndf\", \"output\": \"2\\n2\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nd`da\\\\bb\\ne`cca_\\nca`\\nb_b\\n^`g\\n`f\", \"output\": \"2\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nd`da]bb\\n_acc`e\\nca_\\nb_a\\n]`g\\n`f\", \"output\": \"1\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nd`da]bb\\n_acc`e\\nca_\\nb_a\\n]`g\\n`g\", \"output\": \"1\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nbea`]da\\ndbd_`d\\nba`\\n_ba\\ne]`\\n`h\", \"output\": \"3\\n2\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nbea`]da\\nd`_dbd\\nba`\\n_ba\\ne]`\\n`h\", \"output\": \"2\\n2\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nada^`eb\\ndacb^e\\naba\\naa_\\n\\\\ad\\nj`\", \"output\": \"4\\n2\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nc^`daad\\n^adbde\\nebb\\nbb]\\naZd\\nn`\", \"output\": \"3\\n2\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\ndbad`^d\\nedbd`^\\nbbe\\n^bb\\neYa\\nna\", \"output\": \"5\\n2\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\ndbad`^d\\nedbd`^\\nbbe\\n^bb\\neYb\\nma\", \"output\": \"5\\n2\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nbadbdba\\nbdcaba\\n`bc\\nabc\\nbcb\\nbc\", \"output\": \"4\\n2\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nbadbdba\\nbdcaba\\n`cb\\nabd\\nbcb\\ncc\", \"output\": \"4\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nbadbdba\\nabacdb\\n`cb\\nabd\\nbcb\\ncc\", \"output\": \"4\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nbadbdba\\nabacdb\\n_cb\\nabd\\nbcb\\ncc\", \"output\": \"4\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nbadbdba\\nabacdb\\n_cb\\ndba\\nbcb\\ncc\", \"output\": \"4\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nabdbdab\\nabacdb\\n_cb\\ndba\\nbbb\\ncc\", \"output\": \"4\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nabdbdab\\nabacdb\\n_cb\\ndba\\nbbb\\ncb\", \"output\": \"4\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nabacdb\\n_cb\\ndba\\nbbb\\ncb\", \"output\": \"4\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nabacdb\\n_cb\\ndb`\\nbbb\\ncb\", \"output\": \"4\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nab`cdb\\n_cb\\ndb`\\nbbb\\ncb\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nab`cdb\\n_cb\\ndc`\\nbcb\\ncb\", \"output\": \"3\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nbdc`ba\\n_cb\\ndc`\\nbcb\\ncb\", \"output\": \"3\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nbdc`ba\\n_cb\\ndc`\\ncbb\\ncb\", \"output\": \"3\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nbdc`ba\\n_cb\\ndc`\\nbbc\\ncb\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nbdc`ba\\n`cb\\ndc`\\nbbc\\ncb\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nbdc`ba\\n`cb\\ndc_\\nbbc\\ncb\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nbdc`ba\\n`cb\\ndc_\\nbbc\\nbc\", \"output\": \"3\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdadab\\nbdc`ba\\nbc`\\ndc_\\nbbc\\nbc\", \"output\": \"3\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad`b\\nbdc`ba\\nbc`\\ncd_\\nbbc\\nbc\", \"output\": \"4\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad`b\\nbdc`ba\\nbc`\\nce_\\nbbc\\nbc\", \"output\": \"4\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad`b\\nbdc`ba\\nbc`\\nce^\\nbbc\\nbc\", \"output\": \"4\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad`b\\nbdc`b`\\nbc`\\nce^\\nbbc\\nbc\", \"output\": \"4\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad`b\\n`b`cdb\\nbc`\\nce^\\nbbc\\nbc\", \"output\": \"4\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad`b\\n`b`cdb\\nbc`\\nc^e\\nbbc\\nbc\", \"output\": \"4\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad`b\\nab`cdb\\nbc`\\nc^e\\nbbc\\nbc\", \"output\": \"3\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad`b\\nab`ccb\\nbc`\\nc^e\\nbbc\\nbc\", \"output\": \"3\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad`b\\nab`ccb\\nbc`\\nce^\\nbbc\\nbc\", \"output\": \"3\\n1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad`b\\nab`ccb\\nbc`\\nce^\\nbbc\\ncb\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad_b\\nab`ccb\\nbca\\nce^\\nbbc\\ncb\", \"output\": \"2\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad_b\\nab`ccb\\nbca\\nce^\\nbbd\\ncb\", \"output\": \"2\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad_b\\n`baccb\\nbca\\nce^\\nbbd\\ncb\", \"output\": \"4\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad_b\\n`baccb\\nbca\\nce^\\nbbd\\ncc\", \"output\": \"4\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad_b\\n`baccb\\nacb\\nce^\\nbbd\\ncc\", \"output\": \"4\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bdad_b\\n`baccb\\nacb\\nce_\\nbbd\\ncc\", \"output\": \"4\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n`bcad_b\\n`baccb\\nacb\\nce_\\nbbd\\ncc\", \"output\": \"4\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab_adcb\\n`baccb\\nacb\\nce_\\nbbd\\ncc\", \"output\": \"4\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab_adcb\\n`aaccb\\nacb\\nce_\\nbbd\\ncc\", \"output\": \"4\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab_adcb\\n`accab\\nabb\\n_ec\\nbbd\\ncc\", \"output\": \"3\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab_adcb\\n`accab\\nabb\\n_ec\\nbad\\ncc\", \"output\": \"3\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\n`accab\\nabb\\n_ec\\nbad\\ncc\", \"output\": \"3\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\n`accab\\nabb\\n_ec\\ndab\\ncc\", \"output\": \"3\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\n`aaccb\\nbba\\n_ec\\ndab\\ncc\", \"output\": \"4\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\n`aaccb\\nbca\\n_ec\\ndab\\ncc\", \"output\": \"4\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\n`accab\\nbca\\n_ec\\ndab\\ncc\", \"output\": \"3\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\n`accab\\nbca\\ne_c\\ndab\\ncc\", \"output\": \"3\\n1\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\n`accab\\nbca\\ne_c\\ncab\\ncc\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\n`accab\\nbca\\ne_b\\ncab\\ncc\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\nbacca`\\nbca\\ne_b\\ncab\\ncc\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\nbacca`\\nbca\\ne_b\\nbac\\ncc\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\nbacca`\\nbca\\ne_b\\nbac\\ncd\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab^adcb\\nbacca`\\nacb\\ne_b\\nbac\\ncd\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab]adcb\\nbacca`\\nacb\\ne_b\\nbac\\ncd\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab]adcb\\naacca`\\nacb\\ne_b\\nbac\\ncd\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab]adcb\\naacca_\\nacb\\ne_b\\nbac\\ncd\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab]adcb\\naacca_\\nacb\\ne_b\\nb`c\\ncd\", \"output\": \"3\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab]bdca\\naacca_\\nacc\\ne_b\\nb`c\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab]bdca\\n_accaa\\nacc\\ne_b\\nb`c\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab]bdca\\n_accaa\\ncac\\ne_b\\nb`c\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nab]bdca\\n_accab\\ncac\\ne_b\\nb`c\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nacdb]ba\\n_accab\\ncac\\ne_b\\nb`c\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nacdb]ba\\naacc_b\\ncac\\ne_b\\nb`c\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nacdb]ba\\ncaca_b\\ncac\\ne_b\\nb`c\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nacdb]ba\\ncaca_b\\ncac\\ne_b\\nc`b\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nac]bdba\\ncaca_b\\ncac\\ne_b\\nc`b\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nac]bdba\\ncaca_b\\ncac\\ne_b\\nd`b\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nac]bdba\\ncaca_b\\ncac\\nb_e\\nd`b\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nac]bdba\\nb_acac\\ncac\\nb_e\\nd`b\\ncd\", \"output\": \"3\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nac]bdba\\nb_acac\\ncac\\nb_e\\ne`b\\ncd\", \"output\": \"3\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nac\\\\bdba\\nb_acac\\ncac\\nb_e\\ne`b\\ncd\", \"output\": \"3\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nabcbdab\\nbdcaba\\nabc\\nabc\\nabc\\nbc\", \"output\": \"4\\n3\\n2\"}]",
"style": "rule"
}
|
{
"index": 11385,
"reference": null,
"split": "train"
}
|
primeintellect
|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDima and his friends have been playing hide and seek at Dima's place all night. As a result, Dima's place got messy. In the morning they decided that they need to clean the place.\n\nTo decide who exactly would clean the apartment, the friends want to play a counting-out game. First, all the guys stand in a circle, and then each of them shows some number of fingers on one hand (one to five), and then the boys count in a circle, starting from Dima, the number of people, respective to the total number of fingers shown. The person on who the countdown stops will clean the apartment.\n\nFor example, if Dima and one of his friends played hide and seek, and 7 fingers were shown during the counting-out, then Dima would clean the place. If there were 2 or say, 8 fingers shown, then his friend would clean the place.\n\nDima knows how many fingers each of his friends will show during the counting-out. Now he is interested in the number of ways to show some number of fingers on one hand (one to five), so that he did not have to clean the place. Help Dima.\n\nInput\n\nThe first line contains integer n (1 ≤ n ≤ 100) — the number of Dima's friends. Dima himself isn't considered to be his own friend. The second line contains n positive integers, not exceeding 5, representing, how many fingers the Dima's friends will show. \n\nThe numbers in the lines are separated by a single space.\n\nOutput\n\nIn a single line print the answer to the problem.\n\nExamples\n\nInput\n\n1\n1\n\n\nOutput\n\n3\n\n\nInput\n\n1\n2\n\n\nOutput\n\n2\n\n\nInput\n\n2\n3 5\n\n\nOutput\n\n3\n\nNote\n\nIn the first sample Dima can show 1, 3 or 5 fingers. If Dima shows 3 fingers, then the counting-out will go like that: Dima, his friend, Dima, his friend.\n\nIn the second sample Dima can show 2 or 4 fingers.\n\nThe input will be given via stdin and the output should be printed to stdout by your code.\n\nNow solve the problem by providing the code.",
"role": "user"
}
] |
code
|
{
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1\\n2\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n3 5\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n1\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"49\\n1 4 4 3 5 2 2 1 5 1 2 1 2 5 1 4 1 4 5 2 4 5 3 5 2 4 2 1 3 4 2 1 4 2 1 1 3 3 2 3 5 4 3 4 2 4 1 4 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n5\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"25\\n4 5 5 5 3 1 1 4 4 4 3 5 4 4 1 4 4 1 2 4 2 5 4 5 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 2 5 4 2 2 3 4 4 3 2 3 3 1 3 4 3 3 4 1 3 1 4 5 3 4 3 1 1 1 3 3 2 3 4 3 4 2 2 1 5 1 4 5 1 1 1 3 3 1 1 3 2 5 4 2 5 2 4 5 4 4 1 1 2 1 1 4 5 1 1 5 3 3 2 5 5 5 1 4 1 4 1 1 3 2 3 4 4 2 5 5 2 5 1 1 3 5 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n3 3 1 4 2 4 4 3 1 5 1 1 4 4 3 4 4 3 5 4 5 2 4 3 4 1 2 4 5 4 2 1 5 4 1 1 4 3 2 4 1 2 1 4 4 5 5 4 4 5 3 2 5 1 4 2 2 1 1 2 5 2 5 1 5 3 1 4 3 2 4 3 2 2 4 5 5 1 2 3 1 4 1 2 2 2 5 5 2 3 2 4 3 1 1 2 1 2 1 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"73\\n3 4 3 4 5 1 3 4 2 1 4 2 2 3 5 3 1 4 2 3 2 1 4 5 3 5 2 2 4 3 2 2 5 3 2 3 5 1 3 1 1 4 5 2 4 2 5 1 4 3 1 3 1 4 2 3 3 3 3 5 5 2 5 2 5 4 3 1 1 5 5 2 3\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n2 1 1 3 5 4 4 2 3 4 3 4 5 4 5 4 2 4 5 3 4 5 4 1 1 4 4 1 1 2 5 4 2 4 5 3 2 5 4 3 4 5 1 3 4 2 5 4 5 4 5 2 4 1 2 5 3 1 4 4 5 3 4 3 1 2 5 4 2 5 4 1 5 3 5 4 1 2 5 3 1 1 1 1 5 3 4 3 5 1 1 5 5 1 1 2 2 1 5 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"46\\n1 4 4 5 4 5 2 3 5 5 3 2 5 4 1 3 2 2 1 4 3 1 5 5 2 2 2 2 4 4 1 1 4 3 4 3 1 4 2 2 4 2 3 2 5 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"31\\n3 2 3 3 3 3 4 4 1 5 5 4 2 4 3 2 2 1 4 4 1 2 3 1 1 5 5 3 4 4 1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n2 3 2 2 1 3\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n4 1 3 2 2 4 5\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"41\\n5 3 5 4 2 5 4 3 1 1 1 5 4 3 4 3 5 4 2 5 4 1 1 3 2 4 5 3 5 1 5 5 1 1 1 4 4 1 2 4 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"23\\n5 2 1 1 4 2 5 5 3 5 4 5 5 1 1 5 2 4 5 3 4 4 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"93\\n1 3 1 4 3 3 5 3 1 4 5 4 3 2 2 4 3 1 4 1 2 3 3 3 2 5 1 3 1 4 5 1 1 1 4 2 1 2 3 1 1 1 5 1 5 5 1 2 5 4 3 2 2 4 4 2 5 4 5 5 3 1 3 1 2 1 3 1 1 2 3 4 4 5 5 3 2 1 3 3 5 1 3 5 4 4 1 3 3 4 2 3 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"95\\n4 2 3 4 4 5 2 2 4 4 3 5 3 3 3 5 4 2 5 4 2 1 1 3 4 2 1 3 5 4 2 1 1 5 1 1 2 2 4 4 5 4 5 5 2 1 2 2 2 4 5 5 2 4 3 4 4 3 5 2 4 1 5 4 5 1 3 2 4 2 2 1 5 3 1 5 3 4 3 3 2 1 2 2 1 3 1 5 2 3 1 1 2 5 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"42\\n3 1 2 2 5 1 2 2 4 5 4 5 2 5 4 5 4 4 1 4 3 3 4 4 4 4 3 2 1 3 4 5 5 2 1 2 1 5 5 2 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"73\\n4 1 3 3 3 1 5 2 1 4 1 1 3 5 1 1 4 5 2 1 5 4 1 5 3 1 5 2 4 5 1 4 3 3 5 2 2 3 3 2 5 1 4 5 2 3 1 4 4 3 5 2 3 5 1 4 3 5 1 2 4 1 3 3 5 4 2 4 2 4 1 2 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 3 3 2 5 4 4 2 1 4 4 4 5 4 1 2 1 5 2 4 3 4 1 4 1 2 5 1 4 5 4 2 1 2 5 3 4 5 5 2 1 2 2 2 2 2 3 2 5 1 2 2 3 2 5 5 1 3 4 5 2 1 3 4 2 2 4 4 3 3 3 2 3 2 1 5 5 5 2 1 4 2 3 5 1 4 4 2 3 2 5 5 4 3 5 1 3 5 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n4 2 3 1 3 5\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n4 4 3 5 1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 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\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15\\n5 5 5 3 5 4 1 3 3 4 3 4 1 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n3 5 1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n2 2 5 3 4 3 3 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"96\\n1 5 1 3 2 1 2 2 2 2 3 4 1 1 5 4 4 1 2 3 5 1 4 4 4 1 3 3 1 4 5 4 1 3 5 3 4 4 3 2 1 1 4 4 5 1 1 2 5 1 2 3 1 4 1 2 2 2 3 2 3 3 2 5 2 2 3 3 3 3 2 1 2 4 5 5 1 5 3 2 1 4 3 5 5 5 3 3 5 3 4 3 4 2 1 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"49\\n1 4 4 3 5 2 2 1 5 1 2 1 2 5 1 4 1 4 5 2 4 5 3 5 2 4 0 1 3 4 2 1 4 2 1 1 3 3 2 3 5 4 3 4 2 4 1 4 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"73\\n3 4 3 4 5 1 3 4 2 1 4 2 2 3 5 3 1 4 2 3 2 1 4 5 3 5 2 1 4 3 2 2 5 3 2 3 5 1 3 1 1 4 5 2 4 2 5 1 4 3 1 3 1 4 2 3 3 3 3 5 5 2 5 2 5 4 3 1 1 5 5 2 3\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n4\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n3\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"25\\n4 5 5 5 3 1 1 4 4 4 3 5 4 4 1 1 4 1 2 4 2 5 4 5 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 2 5 4 2 2 3 4 4 3 2 3 3 1 3 4 3 3 4 1 3 1 4 5 3 4 3 1 1 1 3 3 2 3 4 3 4 2 2 1 5 1 4 5 1 1 1 3 3 1 1 3 2 5 4 2 5 2 4 5 4 4 1 1 2 1 1 4 5 1 1 5 3 3 2 5 5 5 1 4 1 4 0 1 3 2 3 4 4 2 5 5 2 5 1 1 3 5 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n3 3 1 4 2 4 4 3 1 5 1 1 4 4 3 4 4 3 5 4 5 2 4 3 4 1 2 4 5 4 2 1 5 4 1 1 4 3 2 4 1 2 1 4 4 5 5 4 4 5 3 2 5 1 4 2 2 1 1 2 5 2 5 1 5 3 1 4 3 2 4 3 0 2 4 5 5 1 2 3 1 4 1 2 2 2 5 5 2 3 2 4 3 1 1 2 1 2 1 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n2 1 1 2 5 4 4 2 3 4 3 4 5 4 5 4 2 4 5 3 4 5 4 1 1 4 4 1 1 2 5 4 2 4 5 3 2 5 4 3 4 5 1 3 4 2 5 4 5 4 5 2 4 1 2 5 3 1 4 4 5 3 4 3 1 2 5 4 2 5 4 1 5 3 5 4 1 2 5 3 1 1 1 1 5 3 4 3 5 1 1 5 5 1 1 2 2 1 5 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"46\\n1 4 4 5 4 5 2 3 5 5 3 2 5 4 1 3 2 2 1 4 3 1 5 5 2 2 2 2 4 4 1 1 4 3 4 3 1 4 2 2 4 2 3 0 5 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"31\\n3 2 3 3 3 3 4 4 1 5 5 4 2 4 3 2 2 1 4 4 1 2 3 1 1 5 5 3 5 4 1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n2 3 2 0 1 3\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n4 1 3 2 2 5 5\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 2 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"41\\n5 3 5 4 2 5 4 3 1 1 1 5 4 3 4 3 5 4 2 5 4 1 1 6 2 4 5 3 5 1 5 5 1 1 1 4 4 1 2 4 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"23\\n5 2 1 1 4 2 5 5 3 5 4 5 5 1 1 5 2 2 5 3 4 4 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"93\\n1 3 1 4 3 3 5 3 1 4 5 4 3 2 2 4 3 1 4 1 2 3 3 3 2 5 1 3 1 4 5 1 1 1 4 2 1 4 3 1 1 1 5 1 5 5 1 2 5 4 3 2 2 4 4 2 5 4 5 5 3 1 3 1 2 1 3 1 1 2 3 4 4 5 5 3 2 1 3 3 5 1 3 5 4 4 1 3 3 4 2 3 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"95\\n4 2 3 4 4 5 2 2 4 4 3 5 3 3 3 5 4 2 5 4 2 1 1 3 4 2 1 3 5 4 2 1 1 5 1 1 2 2 4 4 5 4 5 5 2 1 2 2 2 4 5 5 2 4 3 4 4 3 5 2 4 1 5 4 5 1 3 2 4 2 2 1 5 3 1 5 3 4 3 3 2 1 2 2 2 3 1 5 2 3 1 1 2 5 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"42\\n3 1 2 2 5 1 2 2 4 5 4 5 2 5 4 5 4 4 1 4 3 3 4 4 4 6 3 2 1 3 4 5 5 2 1 2 1 5 5 2 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"73\\n4 1 3 3 3 1 5 2 1 4 1 1 3 5 1 1 4 5 2 1 5 4 1 5 3 1 5 2 4 5 1 4 3 3 5 2 2 3 3 2 5 1 4 5 2 3 1 4 4 3 5 2 3 5 1 4 2 5 1 2 4 1 3 3 5 4 2 4 2 4 1 2 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 3 3 2 5 4 4 2 1 4 4 4 5 4 1 2 1 5 2 4 3 4 1 4 1 2 5 1 4 5 4 2 1 2 5 3 4 5 5 2 1 2 2 2 2 2 3 2 5 1 2 2 3 2 5 5 1 3 7 5 2 1 3 4 2 2 4 4 3 3 3 2 3 2 1 5 5 5 2 1 4 2 3 5 1 4 4 2 3 2 5 5 4 3 5 1 3 5 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n4 2 3 1 2 5\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n4 2 3 5 1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 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\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15\\n1 5 5 3 5 4 1 3 3 4 3 4 1 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n3 3 1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n2 2 5 4 4 3 3 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"96\\n1 5 1 3 2 1 2 2 2 2 3 4 1 1 5 4 4 1 2 3 5 1 4 4 4 1 3 3 1 4 5 4 1 3 5 3 4 4 3 2 1 1 4 4 5 1 1 2 5 1 2 3 1 4 1 2 2 2 3 2 3 3 2 5 4 2 3 3 3 3 2 1 2 4 5 5 1 5 3 2 1 4 3 5 5 5 3 3 5 3 4 3 4 2 1 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n2 5\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"49\\n1 4 4 3 5 2 2 1 5 1 2 1 2 5 1 4 1 4 5 2 4 5 3 5 2 4 0 1 3 4 2 1 4 3 1 1 3 3 2 3 5 4 3 4 2 4 1 4 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"25\\n4 5 5 5 3 1 1 4 4 4 5 5 4 4 1 1 4 1 2 4 2 5 4 5 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 2 5 4 2 2 3 4 4 3 2 3 3 1 3 4 3 3 4 1 3 1 4 5 3 4 3 1 1 1 3 3 2 3 4 3 4 2 2 1 5 1 4 5 1 1 1 3 3 1 1 3 2 5 7 2 5 2 4 5 4 4 1 1 2 1 1 4 5 1 1 5 3 3 2 5 5 5 1 4 1 4 0 1 3 2 3 4 4 2 5 5 2 5 1 1 3 5 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n3 3 1 4 2 4 4 3 1 5 1 1 4 4 3 4 4 3 5 4 5 2 4 3 4 1 2 4 5 4 2 1 5 4 1 1 4 3 2 4 1 2 1 4 4 5 5 4 4 5 3 2 5 1 4 2 2 1 1 2 5 2 5 1 5 3 1 4 3 2 4 3 0 2 4 5 5 1 2 3 1 4 1 2 2 2 5 5 2 3 2 4 3 1 1 1 1 2 1 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"73\\n3 4 3 4 5 1 3 4 2 1 4 2 2 3 5 3 1 4 2 3 2 1 4 5 3 5 2 1 4 3 2 2 5 3 2 3 5 1 3 1 1 4 5 2 4 2 5 1 4 3 1 3 1 4 2 3 3 3 3 5 5 2 5 2 5 4 3 1 1 5 5 2 5\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n2 1 1 2 5 4 4 2 3 4 3 4 5 4 5 4 2 4 5 2 4 5 4 1 1 4 4 1 1 2 5 4 2 4 5 3 2 5 4 3 4 5 1 3 4 2 5 4 5 4 5 2 4 1 2 5 3 1 4 4 5 3 4 3 1 2 5 4 2 5 4 1 5 3 5 4 1 2 5 3 1 1 1 1 5 3 4 3 5 1 1 5 5 1 1 2 2 1 5 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"46\\n1 4 4 5 4 5 2 3 5 5 3 2 5 4 0 3 2 2 1 4 3 1 5 5 2 2 2 2 4 4 1 1 4 3 4 3 1 4 2 2 4 2 3 0 5 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"31\\n3 2 3 3 3 3 1 4 1 5 5 4 2 4 3 2 2 1 4 4 1 2 3 1 1 5 5 3 5 4 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n5 1 3 2 2 5 5\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"41\\n5 3 5 4 2 5 4 3 1 1 1 5 4 3 4 3 5 4 2 5 4 1 1 6 2 4 5 3 5 1 5 5 1 0 1 4 4 1 2 4 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"23\\n5 2 1 1 4 2 5 5 3 5 4 5 5 1 1 5 2 2 5 0 4 4 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"93\\n1 3 1 4 3 3 5 3 1 4 5 4 3 2 2 4 3 1 4 1 2 3 3 3 2 5 1 3 1 4 5 1 1 1 4 2 1 4 0 1 1 1 5 1 5 5 1 2 5 4 3 2 2 4 4 2 5 4 5 5 3 1 3 1 2 1 3 1 1 2 3 4 4 5 5 3 2 1 3 3 5 1 3 5 4 4 1 3 3 4 2 3 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"95\\n4 2 3 4 4 5 2 2 4 4 3 5 3 3 3 5 4 2 5 4 2 1 1 3 4 2 1 3 5 4 2 1 1 5 1 1 2 2 4 4 5 4 5 5 2 1 2 2 2 4 5 5 2 4 3 4 4 3 5 2 5 1 5 4 5 1 3 2 4 2 2 1 5 3 1 5 3 4 3 3 2 1 2 2 2 3 1 5 2 3 1 1 2 5 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"42\\n3 1 2 2 5 1 2 2 4 5 4 5 2 5 4 5 4 4 1 4 3 3 4 4 4 6 3 2 1 3 4 5 5 2 1 2 0 5 5 2 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"73\\n4 1 3 3 3 1 5 2 1 4 1 1 3 5 1 1 4 5 2 1 5 4 1 5 3 1 5 2 4 5 1 4 3 3 5 2 2 3 3 2 5 1 4 5 2 3 1 4 4 3 4 2 3 5 1 4 2 5 1 2 4 1 3 3 5 4 2 4 2 4 1 2 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 3 3 2 5 4 4 2 1 4 4 4 5 4 1 2 1 5 2 4 3 4 1 4 1 2 5 1 4 5 4 2 1 2 5 3 4 5 5 2 1 2 2 2 2 2 3 2 5 1 2 2 3 2 5 5 1 3 7 5 2 1 3 4 2 2 4 4 3 3 3 2 3 2 1 5 5 5 2 1 4 2 3 5 1 4 4 2 3 2 5 5 3 3 5 1 3 5 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n4 4 3 1 2 5\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n4 2 3 8 1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 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 1 4 4 4 4 4 4 4 4 4 4 4 4 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15\\n1 5 4 3 5 4 1 3 3 4 3 4 1 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 3 1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n3 2 5 4 4 3 3 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"96\\n1 5 1 3 2 1 2 2 2 2 3 4 1 1 5 4 4 1 2 3 5 1 4 4 4 1 3 3 1 4 5 4 1 3 5 3 4 4 3 2 1 1 4 4 5 1 1 2 5 1 2 3 1 4 1 2 2 2 3 2 3 3 2 5 4 2 3 3 3 3 2 1 2 4 1 5 1 5 3 2 1 4 3 5 5 5 3 3 5 3 4 3 4 2 1 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n2 1\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"49\\n1 4 4 3 5 2 2 1 5 1 2 1 2 5 1 4 1 6 5 2 4 5 3 5 2 4 0 1 3 4 2 1 4 3 1 1 3 3 2 3 5 4 3 4 2 4 1 4 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"25\\n4 5 5 5 3 1 1 4 4 4 5 5 4 4 1 1 4 1 2 4 2 5 8 5 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 2 5 4 2 2 3 4 4 3 2 3 3 1 3 4 3 3 4 1 3 1 4 5 3 4 3 1 1 0 3 3 2 3 4 3 4 2 2 1 5 1 4 5 1 1 1 3 3 1 1 3 2 5 7 2 5 2 4 5 4 4 1 1 2 1 1 4 5 1 1 5 3 3 2 5 5 5 1 4 1 4 0 1 3 2 3 4 4 2 5 5 2 5 1 1 3 5 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n3 3 1 4 2 4 4 3 1 5 1 1 4 4 3 4 4 3 5 4 5 2 4 3 4 1 2 4 5 4 2 1 5 4 1 1 4 3 2 4 1 2 1 4 4 5 5 4 4 5 3 2 1 1 4 2 2 1 1 2 5 2 5 1 5 3 1 4 3 2 4 3 0 2 4 5 5 1 2 3 1 4 1 2 2 2 5 5 2 3 2 4 3 1 1 1 1 2 1 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"73\\n3 4 3 4 5 1 3 4 2 1 4 2 2 3 5 3 1 4 2 3 2 1 4 5 3 5 2 1 4 3 2 2 5 3 2 3 5 1 3 1 1 4 5 2 4 2 5 1 4 4 1 3 1 4 2 3 3 3 3 5 5 2 5 2 5 4 3 1 1 5 5 2 5\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n2 1 1 2 5 4 4 2 3 4 3 4 5 4 5 4 2 4 5 2 4 5 4 1 1 4 4 1 1 2 5 4 2 4 5 3 2 5 4 3 4 5 1 3 5 2 5 4 5 4 5 2 4 1 2 5 3 1 4 4 5 3 4 3 1 2 5 4 2 5 4 1 5 3 5 4 1 2 5 3 1 1 1 1 5 3 4 3 5 1 1 5 5 1 1 2 2 1 5 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"46\\n1 4 4 5 4 5 2 3 5 5 3 2 5 4 0 3 2 2 1 4 1 1 5 5 2 2 2 2 4 4 1 1 4 3 4 3 1 4 2 2 4 2 3 0 5 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"31\\n3 2 3 3 3 3 1 4 1 5 5 4 2 4 3 2 1 1 4 4 1 2 3 1 1 5 5 3 5 4 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n5 1 3 2 4 5 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"41\\n5 3 5 4 2 5 4 3 1 1 1 5 4 3 4 3 5 8 2 5 4 1 1 6 2 4 5 3 5 1 5 5 1 0 1 4 4 1 2 4 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"23\\n5 2 1 1 4 2 5 5 6 5 4 5 5 1 1 5 2 2 5 0 4 4 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"93\\n1 3 1 4 3 3 5 3 1 4 5 4 3 2 2 4 3 1 4 1 2 3 3 3 2 5 1 3 1 4 5 1 1 1 4 2 1 4 0 1 1 1 5 1 5 5 1 2 5 4 3 2 2 4 4 2 5 4 5 5 3 1 3 1 2 1 3 1 1 2 3 4 4 5 5 3 2 1 3 3 5 1 3 5 4 4 1 3 3 4 2 0 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"95\\n4 2 3 4 4 5 2 2 4 4 3 5 3 3 3 5 4 2 5 4 2 1 1 3 4 2 1 3 5 4 0 1 1 5 1 1 2 2 4 4 5 4 5 5 2 1 2 2 2 4 5 5 2 4 3 4 4 3 5 2 5 1 5 4 5 1 3 2 4 2 2 1 5 3 1 5 3 4 3 3 2 1 2 2 2 3 1 5 2 3 1 1 2 5 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"42\\n3 1 2 2 5 1 2 2 1 5 4 5 2 5 4 5 4 4 1 4 3 3 4 4 4 6 3 2 1 3 4 5 5 2 1 2 0 5 5 2 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"73\\n4 1 3 3 3 1 5 2 1 4 1 1 3 5 1 1 4 5 2 1 5 4 1 5 3 0 5 2 4 5 1 4 3 3 5 2 2 3 3 2 5 1 4 5 2 3 1 4 4 3 4 2 3 5 1 4 2 5 1 2 4 1 3 3 5 4 2 4 2 4 1 2 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 3 3 2 5 4 4 2 1 4 4 4 5 4 1 2 1 5 2 4 3 4 1 4 1 2 5 1 4 5 4 2 1 2 5 3 4 5 5 2 1 2 2 2 2 2 3 2 5 1 2 2 3 2 5 5 1 3 7 5 2 1 3 4 2 2 4 4 3 3 3 2 3 2 1 5 6 5 2 1 4 2 3 5 1 4 4 2 3 2 5 5 3 3 5 1 3 5 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n4 0 3 1 2 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n4 2 3 8 0\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 4 4 4 4 4 4 4 4 5 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 1 4 4 4 4 4 4 4 4 4 4 4 4 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15\\n1 7 4 3 5 4 1 3 3 4 3 4 1 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 3 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n3 4 5 4 4 3 3 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"96\\n1 5 1 3 2 1 2 2 2 2 3 4 1 1 5 4 4 1 2 3 5 1 4 4 4 1 3 3 1 4 5 2 1 3 5 3 4 4 3 2 1 1 4 4 5 1 1 2 5 1 2 3 1 4 1 2 2 2 3 2 3 3 2 5 4 2 3 3 3 3 2 1 2 4 1 5 1 5 3 2 1 4 3 5 5 5 3 3 5 3 4 3 4 2 1 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n3 1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"49\\n1 4 4 3 5 2 2 1 5 1 2 1 2 5 1 4 1 6 5 2 4 5 3 5 2 4 0 1 3 4 2 1 4 3 1 1 3 3 2 3 7 4 3 4 2 4 1 4 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"25\\n4 5 5 5 3 1 1 4 4 4 5 5 4 4 1 1 4 1 2 7 2 5 8 5 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 2 5 4 2 2 3 4 4 3 2 3 3 1 3 4 3 3 4 1 3 1 4 5 3 4 3 1 1 0 3 3 2 3 4 3 4 2 2 1 5 1 4 5 1 1 1 3 2 1 1 3 2 5 7 2 5 2 4 5 4 4 1 1 2 1 1 4 5 1 1 5 3 3 2 5 5 5 1 4 1 4 0 1 3 2 3 4 4 2 5 5 2 5 1 1 3 5 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n3 3 1 4 2 4 4 3 1 5 1 1 4 4 3 4 4 3 5 4 2 2 4 3 4 1 2 4 5 4 2 1 5 4 1 1 4 3 2 4 1 2 1 4 4 5 5 4 4 5 3 2 1 1 4 2 2 1 1 2 5 2 5 1 5 3 1 4 3 2 4 3 0 2 4 5 5 1 2 3 1 4 1 2 2 2 5 5 2 3 2 4 3 1 1 1 1 2 1 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"73\\n3 4 3 4 5 1 3 4 2 1 4 2 2 3 5 3 1 4 2 3 2 1 4 5 3 5 2 1 4 3 2 2 5 3 2 3 5 1 3 1 1 4 5 2 4 2 5 1 4 4 1 3 1 4 2 3 3 3 3 5 5 2 5 2 5 7 3 1 1 5 5 2 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n2 1 1 2 5 4 4 2 3 4 3 4 5 4 5 4 2 4 5 2 4 5 4 1 1 4 4 1 1 2 5 4 2 4 5 3 2 2 4 3 4 5 1 3 5 2 5 4 5 4 5 2 4 1 2 5 3 1 4 4 5 3 4 3 1 2 5 4 2 5 4 1 5 3 5 4 1 2 5 3 1 1 1 1 5 3 4 3 5 1 1 5 5 1 1 2 2 1 5 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"46\\n1 4 4 5 4 5 2 3 6 5 3 2 5 4 0 3 2 2 1 4 1 1 5 5 2 2 2 2 4 4 1 1 4 3 4 3 1 4 2 2 4 2 3 0 5 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"31\\n3 2 3 3 3 3 1 4 1 5 5 4 2 4 3 2 1 1 4 4 1 2 3 1 1 5 5 5 5 4 1\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n5 1 3 2 4 5 6\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"41\\n5 3 5 4 2 5 4 3 1 1 1 5 4 3 4 3 5 8 2 5 4 1 1 6 2 4 5 3 0 1 5 5 1 0 1 4 4 1 2 4 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"23\\n5 4 1 1 4 2 5 5 6 5 4 5 5 1 1 5 2 2 5 0 4 4 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"93\\n1 3 1 4 3 3 5 3 1 4 5 4 3 2 2 4 3 1 4 1 2 3 3 3 2 5 1 3 1 4 5 1 1 1 4 2 1 4 0 1 1 1 5 1 5 5 1 2 5 4 3 2 2 4 4 2 5 4 5 5 3 1 3 1 2 1 3 1 0 2 3 4 4 5 5 3 2 1 3 3 5 1 3 5 4 4 1 3 3 4 2 0 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"95\\n4 2 3 4 4 5 2 2 4 4 3 5 3 3 3 5 4 2 5 4 2 1 1 3 4 2 1 3 5 4 0 1 1 5 1 1 2 2 4 4 5 4 5 5 2 1 2 2 2 4 5 5 2 4 3 4 4 3 5 2 5 1 5 4 5 1 3 2 4 2 2 1 5 3 1 5 5 4 3 3 2 1 2 2 2 3 1 5 2 3 1 1 2 5 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"42\\n3 1 2 2 5 1 2 2 1 5 4 5 2 5 4 5 4 4 1 4 3 3 0 4 4 6 3 2 1 3 4 5 5 2 1 2 0 5 5 2 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"73\\n4 1 3 3 3 1 5 2 1 4 1 1 3 5 1 1 4 5 2 1 5 4 1 5 3 0 5 2 4 5 1 4 3 3 5 2 2 3 3 2 5 1 4 5 2 3 1 4 2 3 4 2 3 5 1 4 2 5 1 2 4 1 3 3 5 4 2 4 2 4 1 2 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 3 3 2 5 4 4 2 1 4 4 4 5 4 1 2 1 5 2 4 3 4 1 4 1 2 5 1 4 5 4 2 1 2 5 3 4 5 5 2 1 2 2 2 2 2 3 2 5 1 2 2 3 2 5 5 1 3 7 5 2 1 3 4 2 2 4 4 3 3 3 2 3 2 1 5 6 5 2 1 4 2 3 5 1 4 4 1 3 2 5 5 3 3 5 1 3 5 5\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n4 0 3 1 2 4\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n4 3 3 8 0\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n4 4 4 4 4 4 4 4 4 4 5 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 1 4 4 4 4 4 4 4 4 4 4 4 4 4 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15\\n1 7 4 3 5 4 1 3 3 7 3 4 1 4 4\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 3 3\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n3 6 5 4 4 3 3 2\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"96\\n1 5 1 3 2 1 2 2 2 2 3 4 1 1 5 4 4 1 2 3 5 1 4 4 4 1 3 3 1 4 5 2 1 3 5 3 4 1 3 2 1 1 4 4 5 1 1 2 5 1 2 3 1 4 1 2 2 2 3 2 3 3 2 5 4 2 3 3 3 3 2 1 2 4 1 5 1 5 3 2 1 4 3 5 5 5 3 3 5 3 4 3 4 2 1 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n4 1\\n\", \"output\": \"3\\n\"}]",
"style": "rule"
}
|
{
"index": 3484,
"reference": null,
"split": "train"
}
|
primeintellect
| [{"content":"Solve the following coding problem using the programming language python:\n\nLet us con(...TRUNCATED) |
code
| {"ground_truth":"[{\"type\": \"stdin_stdout\", \"input\": \"2\", \"output\": \"-1\"}, {\"type\": \"s(...TRUNCATED) |
{
"index": 9521,
"reference": null,
"split": "train"
}
|
primeintellect
| [{"content":"Solve the following coding problem using the programming language python:\n\nIt is said(...TRUNCATED) |
code
| {"ground_truth":"[{\"type\": \"stdin_stdout\", \"input\": \"4\\n1 1\\n2 2 3\\n2 1 2\\n3 4 4 5\\n0\",(...TRUNCATED) |
{
"index": 12630,
"reference": null,
"split": "train"
}
|
primeintellect
| [{"content":"Solve the following coding problem using the programming language python:\n\nJATC's mat(...TRUNCATED) |
code
| {"ground_truth":"[{\"type\": \"stdin_stdout\", \"input\": \"20\\n\", \"output\": \"10 2\\n\"}, {\"ty(...TRUNCATED) |
{
"index": 3352,
"reference": null,
"split": "train"
}
|
End of preview. Expand
in Data Studio
No dataset card yet
- Downloads last month
- 16