messages listlengths 1 1 | ground_truth stringlengths 88 726k | dataset stringclasses 1
value |
|---|---|---|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnatoly lives in the university dorm as many other students do. As you know, cockroaches are also living there together with students. Cockroaches might be of two colors: black and red. There are n cockroaches living in A... | [{"type": "stdin_stdout", "input": "166\nrbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbbbbrbbbbbbbrbbbbbbbrbbrbbbbbbbbrbbbbbbbbbbbbbbrrbbbrbbbbbbbbbbbbbbrbrbbbbbbbbbbbrbbbbbbbbbbbbbbrbbbbbbbbbbbbbbbbbbbbbb\n", "output": "70\n"}, {"type": "stdin_stdout", "input": "166\nrbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbb... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe north country is conquered by the great shogun-sama (which means king). Recently many beautiful dice which were made by order of the great shogun-sama were given to all citizens of the country. All citizens received t... | [{"type": "stdin_stdout", "input": "1 2\n10 8\n0 0\n0 1\n3 3\n1 3 5\n2 13 1\n1 0 2\n0 0\n0 2\n3 3\n1 2 4\n4 8 10\n1 1 2\n0 0\n1 2\n2 2\n1 2\n5 4\n1 0\n0 1\n2 3\n1 2 3\n5 5 6\n0 0\n1 2\n0 0", "output": "24\n14\n30\n11\n21\n"}, {"type": "stdin_stdout", "input": "1 2\n10 8\n0 0\n0 1\n3 3\n1 3 5\n2 13 1\n1 0 2\n0 0\n0 2\n3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour program fails again. This time it gets \"Wrong answer on test 233\".\n\nThis is the harder version of the problem. In this version, $1 \\le n \\le 2\\cdot10^5$. You can hack this problem if you locked it. But you can... | [{"type": "stdin_stdout", "input": "100 100\n82 51 14 14 37 17 78 92 64 15 8 86 89 8 87 77 30 15 15 12 100 25 161 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 148 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 118 52 74 31 92 43 70 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBad news came to Mike's village, some thieves stole a bunch of chocolates from the local factory! Horrible! \n\nAside from loving sweet things, thieves from this area are known to be very greedy. So after a thief takes hi... | [{"type": "stdin_stdout", "input": "1000000000000000\n", "output": "4949100894494448\n"}, {"type": "stdin_stdout", "input": "1000000000000000\n", "output": "4949100894494448\n"}, {"type": "stdin_stdout", "input": "999999999999997\n", "output": "4949100894494440\n"}, {"type": "stdin_stdout", "input": "999999999999996\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ of length $n$. The array is called 3SUM-closed if for all distinct indices $i$, $j$, $k$, the sum $a_i + a_j + a_k$ is an element of the array. More formally, $a$ is 3SUM-closed if for all integ... | [{"type": "stdin_stdout", "input": "4\n3\n-1 0 1\n5\n1 -2 -2 1 -3\n6\n0 0 0 0 0 0\n4\n-1 2 -3 4\n", "output": "YES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "1\n3\n0 65536 65536\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1\n4\n-3 -1 1 1\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr. Kitayuta has kindly given you a string s consisting of lowercase English letters. You are asked to insert exactly n lowercase English letters into s to make it a palindrome. (A palindrome is a string that reads the sa... | [{"type": "stdin_stdout", "input": "ccxsecrxosqsrsoolxzcoolqllexxssxqoqeqkocerchlxckqschxxczlxscoxhszsoxzxrzohsccsclocxxzshrhzoexxhrohqrrqhorhxxeozhrhszxxcolcsccshozrxzxoszshxocsxlzcxxhcsqkcxlhcrecokqeqoqxssxxellqlooczxloosrsqsoxrcesxcc\n536870712\n", "output": "ccxsecrxosqsrsoolxzcoolqllexxssxqoqeqkocerchlxckqschxxczl... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are?\n\nConstraints\n\n* 1 ≤ N,A,B ≤ 10^9\n* A and B are ... | [{"type": "stdin_stdout", "input": "13 -10 2", "output": "133\n"}, {"type": "stdin_stdout", "input": "125 -2 0", "output": "247\n"}, {"type": "stdin_stdout", "input": "109 0 1", "output": "108\n"}, {"type": "stdin_stdout", "input": "109 0 2", "output": "215\n"}, {"type": "stdin_stdout", "input": "19 -7 -2", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.\n\nAs shown in the following figure, his house has 9 rooms, where each roo... | [{"type": "stdin_stdout", "input": "1\nC A C\n1\nE C A\n10\nF A B\n0", "output": "0.00000000\n0.00000000\n0.07220459\n"}, {"type": "stdin_stdout", "input": "1\nC A C\n2\nE C A\n10\nF A B\n0", "output": "0.00000000\n0.12500000\n0.07220459\n"}, {"type": "stdin_stdout", "input": "1\nC A C\n1\nF C A\n10\nF A B\n0", "output... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolo, the Penguin, likes numbers. He says that the goodness of a number is itself multiplied by the number of digits in it's decimal representation. For example, the goodness of the integer 474 is 474*3 = 1422.\nHelp him ... | [{"type": "stdin_stdout", "input": "1\n13 393", "output": "227157\n"}, {"type": "stdin_stdout", "input": "1\n15 149", "output": "28365\n"}, {"type": "stdin_stdout", "input": "1\n15 260", "output": "96630\n"}, {"type": "stdin_stdout", "input": "1\n13 260", "output": "96684\n"}, {"type": "stdin_stdout", "input": "1\n13 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ people sitting in a circle, numbered from $1$ to $n$ in the order in which they are seated. That is, for all $i$ from $1$ to $n-1$, the people with id $i$ and $i+1$ are adjacent. People with id $n$ and $1$ a... | [{"type": "stdin_stdout", "input": "735134400\n", "output": "1 367567202 735134403 1102701604 1470268805 1837836006 2205403207 2572970408 2940537609 3308104810 3675672011 4043239212 4410806413 4778373614 5145940815 5513508016 5881075217 6248642418 6983776820 7351344021 7718911222 8454045624 8821612825 9189180026 955674... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks for the number of positive integers n, such that the factorial of n ends with exactly m zeroes. Are you... | [{"type": "stdin_stdout", "input": "43857\n", "output": "5 \n 175440 175441 175442 175443 175444\n"}, {"type": "stdin_stdout", "input": "27438\n", "output": "5 \n 109760 109761 109762 109763 109764\n"}, {"type": "stdin_stdout", "input": "31693\n", "output": "5 \n 126785 126786 126787 126788 126789\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Tanya decided to present her dad a postcard on his Birthday. She has already created a message — string s of length n, consisting of uppercase and lowercase English letters. Tanya can't write yet, so she found a ne... | [{"type": "stdin_stdout", "input": "DpiNBmCRFWxpdbfGOzvvOcemjructoAdEwegTvbVbfWWRPGyEAxGdDRWVlqNyGWMWHMrHAIZpyxvgaflrsVZhhZRouvpxrKXFZam\nwwPLFtNfPtJXvMLuHjKfYyaRhreNSWSzOvDpqHCGcqllACNPGHxReeFUCmAqIKXYytsSQwIxJzNiiUtgebVuwRmWpRALLyKAzyDPvgIGxALSaeeTIqm\n", "output": "66 12\n"}, {"type": "stdin_stdout", "input": "DpiNB... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt is Borya's eleventh birthday, and he has got a great present: n cards with numbers. The i-th card has the number a_{i} written on it. Borya wants to put his cards in a row to get one greater number. For example, if Bor... | [{"type": "stdin_stdout", "input": "4\n2\n1 1\n3\n2 31 12\n3\n21646 67 98\n9\n1 2 3 14 4 11 7 8 9\n", "output": "2\n0\n1\n36288\n"}, {"type": "stdin_stdout", "input": "4\n2\n1 1\n3\n1 31 12\n3\n12345 67 84\n9\n1 2 3 4 5 1 7 8 16\n", "output": "2\n2\n2\n36288\n"}, {"type": "stdin_stdout", "input": "4\n2\n1 1\n3\n1 20 12... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRoma works in a company that sells TVs. Now he has to prepare a report for the last year.\n\nRoma has got a list of the company's incomes. The list is a sequence that consists of n integers. The total income of the compan... | [{"type": "stdin_stdout", "input": "78 13\n-9961 -9922 -9817 -9813 -9521 -9368 -9361 -9207 -9153 -9124 -9008 -8981 -8951 -8911 -8551 -8479 -8245 -8216 -7988 -7841 -7748 -7741 -7734 -7101 -6846 -6804 -6651 -6526 -6519 -6463 -6297 -6148 -6090 -5845 -5209 -5201 -5161 -5061 -4537 -4529 -4433 -4370 -4266 -4189 -4125 -3945 -... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\n----... | [{"type": "stdin_stdout", "input": "96 1", "output": "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n"}, {"type": "stdin_stdout", "input": "10 40", "output": "10101010101010101010101010101010101010101010101010101010101010101010101010101010\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's now 260 AD. Shapur, being extremely smart, became the King of Persia. He is now called Shapur, His majesty King of kings of Iran and Aniran.\n\nRecently the Romans declared war on Persia. They dreamed to occupy Armen... | [{"type": "stdin_stdout", "input": "17 17\n00000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "34 17\n00000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a board with H horizontal rows and W vertical columns of squares. There is a bishop at the top-left square on this board. How many squares can this bishop reach by zero or more movements?\n\nHere the bishop can on... | [{"type": "stdin_stdout", "input": "1001000000 1000000000", "output": "500500000000000000\n"}, {"type": "stdin_stdout", "input": "1001000000 1100000000", "output": "550550000000000000\n"}, {"type": "stdin_stdout", "input": "1001000010 1100000000", "output": "550550005500000000\n"}, {"type": "stdin_stdout", "input": "10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke has N integers: 1,2,\\ldots,N. He will choose K of them and give those to Takahashi.\n\nHow many ways are there to choose K consecutive integers?\n\nConstraints\n\n* All values in input are integers.\n* 1 \\leq K \\... | [{"type": "stdin_stdout", "input": "1 -159", "output": "161\n"}, {"type": "stdin_stdout", "input": "119 -1", "output": "121\n"}, {"type": "stdin_stdout", "input": "2 -107", "output": "110\n"}, {"type": "stdin_stdout", "input": "0 -159", "output": "160\n"}, {"type": "stdin_stdout", "input": "112 -1", "output": "114\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSasha grew up and went to first grade. To celebrate this event her mother bought her a multiplication table $M$ with $n$ rows and $n$ columns such that $M_{ij}=a_i \\cdot a_j$ where $a_1, \\dots, a_n$ is some sequence of ... | [{"type": "stdin_stdout", "input": "10\n0 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 0 1 1 1 1 1 1 1 1\n1000000000 1 0 1 1 1 1 1 1 1\n1000000000 1 1 0 1 1 1 1 1 1\n1000000000 1 1 1 0 1 1 1 1 1\n1000000000 1 1 1 1 0 1 1 1 1\n1000000000 1 1 1 1 1 0 1 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a program that consists of $n$ instructions. Initially a single variable $x$ is assigned to $0$. Afterwards, the instructions are of two types:\n\nincrease $x$ by $1$;\n\ndecrease $x$ by $1$.\n\nYou are give... | [{"type": "stdin_stdout", "input": "2\n8 4\n-+--+--+\n1 8\n2 8\n2 5\n1 1\n4 10\n+-++\n1 1\n1 2\n2 2\n1 3\n2 3\n3 3\n1 4\n2 4\n3 4\n4 4\n", "output": "\n1\n2\n4\n4\n3\n3\n4\n2\n3\n2\n1\n2\n2\n2\n"}, {"type": "stdin_stdout", "input": "2\n8 4\n-+--+--+\n1 8\n2 8\n2 5\n1 1\n4 10\n+-++\n1 1\n1 2\n2 2\n1 3\n2 3\n3 3\n1 4\n2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDevelopers often face with regular expression patterns. A pattern is usually defined as a string consisting of characters and metacharacters that sets the rules for your search. These patterns are most often used to check... | [{"type": "stdin_stdout", "input": "100\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\n?b\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1^{n} + 2^{n} + 3^{n} + 4^{n}) mod 5\n\nfor given value of n. Fedya managed to complete the task. Can you? Note that given num... | [{"type": "stdin_stdout", "input": "124356983594583453458888889\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "124356983594583453458888889\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1134974\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1236642\n", "output": "0\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKuroni is very angry at the other setters for using him as a theme! As a punishment, he forced them to solve the following problem:\n\nYou have an array $a$ consisting of $n$ positive integers. An operation consists of ch... | [{"type": "stdin_stdout", "input": "10\n648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 724560300002\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n169999847 169999847 169999847 300469729580 169999847\n", "output": "3\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSonya decided to organize an exhibition of flowers. Since the girl likes only roses and lilies, she decided that only these two kinds of flowers should be in this exhibition.\n\nThere are $n$ flowers in a row in the exhib... | [{"type": "stdin_stdout", "input": "1582 10\n587 646\n1148 843\n326 875\n439 485\n465 521\n330 387\n405 480\n477 115\n572 376\n715 771\n", "output": "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLong ago, when Petya was a schoolboy, he was very much interested in the Petr# language grammar. During one lesson Petya got interested in the following question: how many different continuous substrings starting with the... | [{"type": "stdin_stdout", "input": "bgphoaomnjcjhgkgbflfclbjmkbfonpbmkdomjmkahaoclcbijdjlllnpfkbilgiiidbabgojbbfmliemhicaanadbaahagmfdldbbklelkihlcbkhchlikhefeeafbhkabfdlhnnjnlimbhneafcfeapcbeifgcnaijdnkjpikedmdbhahhgcijddfmamdiaapaeimdhfblpkedamifbbdndmmljmdcffcpmanndeeclnpnkdoieiahchdnkdmfnbocnimclgckdcbp\npcbeifgcna... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Aizuwakamatsu City, there is a first city called \"Tokaichi\" on January 10th every year. This Tokaichi has a history of about 600 years and is the largest first city in the Aizu region. It is also well known that Okia... | [{"type": "stdin_stdout", "input": "1593 4311\n4321 2155\n1256 11201\n5310 1455\n2152 5421\n1928 3386\n4528 1578\n1234 4321\n3330 3109\n2739 2199\n0 0", "output": "C 12457\nD 6439\n"}, {"type": "stdin_stdout", "input": "1593 4311\n4321 2155\n1256 12219\n5310 1455\n2152 5421\n1549 3288\n4528 3719\n1234 4321\n3330 2166\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Vasya loves orange juice very much. That's why any food and drink in his kitchen necessarily contains orange juice. There are n drinks in his fridge, the volume fraction of orange juice in the i-th drink equals pi ... | [{"type": "stdin_stdout", "input": "100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 101 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPatrick has just finished writing a message to his sweetheart Stacey when he noticed that the message didn't look fancy. Patrick was nervous while writing the message, so some of the letters there were lowercase and some ... | [{"type": "stdin_stdout", "input": "MMVESdOCALHJCTBTUWWQRGUUVTTTABKKAAdIINAdKLRLLVLODHDXDPMcQfUhPNHFBJSDRGsHZNORSCPNvKOOIuZnZAmTPUCoPNlR\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "MMbJIBhgFXPVpdQHLkWJkAHFIfJSpITTCRzRCzvRPRYECCheOknfINZWuKATDBOrEVKTcWXiYPjtzQMGUSGPNTMCUrvYCSWQHqAi\n", "output": "27\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N people (with different names) and K clubs. For each club you know the list of members (so you have K unordered lists). Each person can be a member of many clubs (and also 0 clubs) and two different clubs might... | [{"type": "stdin_stdout", "input": "119107271329329921", "output": "-1\n"}, {"type": "stdin_stdout", "input": "33213408621377322", "output": "-1\n"}, {"type": "stdin_stdout", "input": "26939847318901699", "output": "-1\n"}, {"type": "stdin_stdout", "input": "12809773843701327", "output": "-1\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMike received an array $a$ of length $n$ as a birthday present and decided to test how pretty it is.\n\nAn array would pass the $i$-th prettiness test if there is a way to get an array with a sum of elements totaling $s_i... | [{"type": "stdin_stdout", "input": "2\n5 5\n1 2 3 4 5\n1\n5\n9\n12\n6\n5 5\n6 1 3 2 3\n1\n2\n3\n15\n11\n", "output": "Yes\nYes\nYes\nNo\nYes\nYes\nYes\nYes\nYes\nNo\n"}, {"type": "stdin_stdout", "input": "2\n5 5\n1 2 3 4 5\n1\n5\n3\n12\n6\n5 5\n6 1 3 2 3\n1\n2\n3\n15\n11\n", "output": "Yes\nYes\nYes\nNo\nYes\nYes\nYes\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.\nCurrently, he is located at the point (sx,sy). In each second, he can move up, down, left o... | [{"type": "stdin_stdout", "input": "-49 -32 -1 -4", "output": "UUUUUUUUUUUUUUUUUUUUUUUUUUUURRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLUUUUUUUUUUUUUUUUUUUUUUUUUUUUURRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDRDDDDDDDDDDDDDDDDDDDDDDDD... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou like playing chess tournaments online.\n\nIn your last tournament you played $n$ games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get $0$ points. When you... | [{"type": "stdin_stdout", "input": "8\n5 2\nWLWLL\n6 5\nLLLWWL\n7 4\nLWLWLWL\n15 5\nWWWLLLWWWLLLWWW\n40 38\nLLWLWLWWWLWLLWLWWWLWLLWLLWLLLLWLLWWWLWWL\n1 0\nL\n1 0\nL\n6 0\nWLLWLW\n", "output": "7\n11\n13\n26\n79\n0\n0\n3\n"}, {"type": "stdin_stdout", "input": "8\n5 2\nWLWLL\n6 5\nLLLWWL\n7 4\nLWLWLWL\n15 2\nWWWLLLWWWLLL... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya commutes by train every day. There are n train stations in the city, and at the i-th station it's possible to buy only tickets to stations from i + 1 to a_{i} inclusive. No tickets are sold at the last station.\n\nL... | [{"type": "stdin_stdout", "input": "10\n2 10 8 7 8 8 10 9 10\n", "output": "63\n"}, {"type": "stdin_stdout", "input": "10\n2 10 8 7 8 8 10 9 10\n", "output": "63\n"}, {"type": "stdin_stdout", "input": "10\n2 10 8 7 8 9 10 9 10\n", "output": "62\n"}, {"type": "stdin_stdout", "input": "10\n3 10 8 7 8 9 10 9 10\n", "outpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter many years of research, Ikta has acquired the ability to predict the future! The time and money he spent on this research was enormous, but it's finally time to be rewarded. To get the money back, Ikta decided to st... | [{"type": "stdin_stdout", "input": "3 3 10\n18 1 13\n15 3 3\n5 10 0", "output": "100\n"}, {"type": "stdin_stdout", "input": "3 3 10\n10 14 13\n14 2 6\n5 4 1", "output": "28\n"}, {"type": "stdin_stdout", "input": "3 3 10\n18 4 13\n15 3 3\n5 11 1", "output": "34\n"}, {"type": "stdin_stdout", "input": "3 3 10\n18 4 13\n15... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProgrammer Vasya is studying a new programming language &K*. The &K* language resembles the languages of the C family in its syntax. However, it is more powerful, which is why the rules of the actual C-like languages are ... | [{"type": "stdin_stdout", "input": "10\ntypedef &void**** youdyfpinzk\ntypeof &youdyfpinzk***\ntypedef &&&&youdyfpinzk****** nfbsgpjzhxzskmxc\ntypeof nfbsgpjzhxzskmxc***\ntypedef &&&void*** puerqioirikxej\ntypeof &puerqioirikxej********\ntypedef &puerqioirikxej******** xzgzsamjdufuyxz\ntypeof &xzgzsamjdufuyxz******\nty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the army, it isn't easy to form a group of soldiers that will be effective on the battlefield. The communication is crucial and thus no two soldiers should share a name (what would happen if they got an order that Bob ... | [{"type": "stdin_stdout", "input": "50 2\nYES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES\n", "output": "Ab Ac Ad Ae Af Ag Ah Ai Aj Ak Al Am An Ao Ap Aq Ar As At Au Av Aw A... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W.\nIf we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the... | [{"type": "stdin_stdout", "input": "-1 -1 100", "output": "102\n"}, {"type": "stdin_stdout", "input": "-1 -1 101", "output": "103\n"}, {"type": "stdin_stdout", "input": "-1 -1 111", "output": "113\n"}, {"type": "stdin_stdout", "input": "0 -116 -1", "output": "115\n"}, {"type": "stdin_stdout", "input": "-2 -1 111", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nStudent Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. ... | [{"type": "stdin_stdout", "input": "1\n1001000000 999999999\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "1\n1101010000 523461264\n", "output": "523461264\n"}, {"type": "stdin_stdout", "input": "1\n1101000000 193606579\n", "output": "193606579\n"}, {"type": "stdin_stdout", "input": "1\n1101000000 142... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider a football tournament where n teams participate. Each team has two football kits: for home games, and for away games. The kit for home games of the i-th team has color x_{i} and the kit for away games of this tea... | [{"type": "stdin_stdout", "input": "30\n25 8\n25 4\n21 9\n25 1\n7 16\n23 21\n22 17\n27 29\n7 29\n20 3\n13 23\n7 13\n16 18\n25 14\n13 17\n28 15\n10 23\n25 18\n2 3\n23 13\n30 8\n13 15\n20 15\n11 29\n10 23\n5 16\n4 14\n4 30\n7 20\n11 1\n", "output": "29 29\n31 27\n29 29\n29 29\n30 28\n30 28\n29 29\n29 29\n29 29\n29 29\n31... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nПрошло много лет, и на вечеринке снова встретились n друзей. С момента последней встречи техника шагнула далеко вперёд, появились фотоаппараты с автоспуском, и теперь не требуется, чтобы один из друзей стоял с фотоаппарат... | [{"type": "stdin_stdout", "input": "42\n13 62\n114 242\n265 839\n756 349\n298 476\n533 704\n348 277\n554 573\n654 112\n429 836\n574 766\n909 415\n163 891\n532 983\n873 457\n719 117\n1 302\n170 634\n166 585\n721 231\n208 609\n128 246\n845 726\n604 119\n859 110\n568 515\n656 913\n113 166\n794 566\n834 860\n983 596\n545 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given n segments on a number line, numbered from 1 to n. The i-th segments covers all integer points from l_i to r_i and has a value w_i.\n\nYou are asked to select a subset of these segments (possibly, all of the... | [{"type": "stdin_stdout", "input": "45 100\n86 90 344\n67 71 63\n84 87 423\n96 98 297\n85 86 144\n75 80 489\n24 25 17\n75 78 363\n1 3 349\n17 19 146\n35 38 39\n90 93 236\n34 35 463\n59 64 259\n97 100 185\n71 75 214\n80 84 124\n63 67 324\n85 88 204\n47 51 420\n22 24 38\n30 34 41\n94 96 42\n3 6 312\n51 56 440\n84 85 337\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnother programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However,... | [{"type": "stdin_stdout", "input": "50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a string consisting of only numbers from 0 to 9, consider the operation of creating a new string from that string according to the following rules. Read the given string one character at a time from the left end. Go... | [{"type": "stdin_stdout", "input": "5\n28\n14\n1\n0", "output": "11131221121113122118\n311311222113111231131112132112311321322112111312211312111322212311322113212221\n"}, {"type": "stdin_stdout", "input": "5\n23\n14\n1\n0", "output": "11131221121113122113\n311311222113111231131112132112311321322112111312211312111322212... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSuppose you have two points $p = (x_p, y_p)$ and $q = (x_q, y_q)$. Let's denote the Manhattan distance between them as $d(p, q) = |x_p - x_q| + |y_p - y_q|$.\n\nLet's say that three points $p$, $q$, $r$ form a bad triple ... | [{"type": "stdin_stdout", "input": "3\n4\n2 4 1 3\n5\n6 9 1 18 12\n2\n13 37\n", "output": "10\n13\n3\n"}, {"type": "stdin_stdout", "input": "3\n4\n2 4 1 3\n5\n6 9 2 18 12\n2\n13 37\n", "output": "10\n13\n3\n"}, {"type": "stdin_stdout", "input": "3\n4\n2 4 1 3\n5\n0 9 2 18 12\n2\n13 37\n", "output": "10\n13\n3\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEvery superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations.\n\nInitially, there are $n$ ... | [{"type": "stdin_stdout", "input": "9 48096 5475634\n28248 27808 75072 58867 37890 95515 26685 68307 40390\n", "output": "143611.00000000000000000000\n"}, {"type": "stdin_stdout", "input": "9 29221 2106895\n82089 18673 2890 99009 89855 30685 39232 82330 30021\n", "output": "128230.00000000000000000000\n"}, {"type": "st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGag\n\nSegtree has $ N $ of \"gags\", each with a value of $ V_i $.\n\nSegtree decided to publish all the gags in any order.\n\nHere, the \"joy\" you get when you publish the $ i $ th gag to the $ j $ th is expressed as $... | [{"type": "stdin_stdout", "input": "1\n114525", "output": "114524\n"}, {"type": "stdin_stdout", "input": "1\n105905", "output": "105904\n"}, {"type": "stdin_stdout", "input": "1\n196252", "output": "196251\n"}, {"type": "stdin_stdout", "input": "1\n127413", "output": "127412\n"}, {"type": "stdin_stdout", "input": "1\n3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently.\n\n\n\nInput\n\nA sequence of integers ai (1 ≤ ai ≤ 10... | [{"type": "stdin_stdout", "input": "5\n11\n3\n5\n8\n10\n11\n8\n29\n1\n3\n2", "output": "3\n5\n8\n11\n"}, {"type": "stdin_stdout", "input": "5\n11\n4\n10\n4\n-1\n20\n8\n20\n2\n8\n0", "output": "4\n8\n20\n"}, {"type": "stdin_stdout", "input": "5\n11\n2\n11\n1\n-2\n20\n8\n22\n2\n6\n1", "output": "1\n2\n11\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya's house is situated in a forest, and there is a mushroom glade near it. The glade consists of two rows, each of which can be divided into n consecutive cells. For each cell Vasya knows how fast the mushrooms grow in... | [{"type": "stdin_stdout", "input": "6\n4 1 11 9 3 11\n12 32 19 12 19 11\n", "output": "1035\n"}, {"type": "stdin_stdout", "input": "6\n4 1 11 6 3 11\n12 32 19 12 19 11\n", "output": "1026\n"}, {"type": "stdin_stdout", "input": "6\n4 1 11 6 3 18\n12 32 19 12 19 11\n", "output": "1061\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPerhaps many have heard that the World Biathlon Championship has finished. Although our hero Valera was not present at this spectacular event himself and only watched it on TV, it excited him so much that he decided to en... | [{"type": "stdin_stdout", "input": "15\n17 5\n-19 5\n-8 3\n27 2\n45 3\n36 2\n-32 2\n49 1\n-3 2\n-41 2\n-35 1\n-46 1\n-29 1\n33 1\n0 1\n50\n24 -4\n41 3\n37 3\n9 2\n38 -4\n-30 2\n-41 -5\n-9 -5\n-33 3\n0 2\n-20 -3\n-49 -4\n34 1\n-38 -2\n17 -1\n-33 3\n-17 4\n16 3\n-49 2\n-3 -4\n-9 2\n35 3\n37 -5\n0 0\n-46 -5\n48 1\n-22 -4\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke is going to open a contest named \"AtCoder s Contest\".\nHere, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase E... | [{"type": "stdin_stdout", "input": "AtCoder Beginner Contest\n", "output": "ABC\n"}, {"type": "stdin_stdout", "input": "AtCoder Befinner Contest", "output": "ABC\n"}, {"type": "stdin_stdout", "input": "AtCoder sennifeB Cpntest", "output": "AsC\n"}, {"type": "stdin_stdout", "input": "AtCoder rennigeB Contest", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPermutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct positive integers not larger than n. We'll denote as n the length of permutation p1, p2, ..., pn.\n\nYour task is to find such permutat... | [{"type": "stdin_stdout", "input": "18247 939\n", "output": "1 940 2 939 3 938 4 937 5 936 6 935 7 934 8 933 9 932 10 931 11 930 12 929 13 928 14 927 15 926 16 925 17 924 18 923 19 922 20 921 21 920 22 919 23 918 24 917 25 916 26 915 27 914 28 913 29 912 30 911 31 910 32 909 33 908 34 907 35 906 36 905 37 904 38 903 39... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe only difference between easy and hard versions is constraints.\n\nIvan plays a computer game that contains some microtransactions to make characters look cooler. Since Ivan wants his character to be really cool, he wa... | [{"type": "stdin_stdout", "input": "78 36\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0\n1 52\n2 6\n9 43\n10 52\n4 63\n9 35\n10 67\n9 17\n3 43\n4 38\n1 27\n9 44\n6 74\n7 3\n8 18\n1 52\n1 68\n5 51\n5 2\n11 50\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an expression of the form $a{+}b$, where $a$ and $b$ are integers from $0$ to $9$. You have to evaluate it and print the result.\n\n\n-----Input-----\n\nThe first line contains one integer $t$ ($1 \\le t \\l... | [{"type": "stdin_stdout", "input": "100\n0+0\n0+1\n0+2\n0+3\n0+4\n0+5\n0+6\n0+7\n0+8\n0+9\n1+0\n1+1\n1+2\n1+3\n1+4\n1+5\n1+6\n1+7\n1+8\n1+9\n2+0\n2+1\n2+2\n2+3\n2+4\n2+5\n2+6\n2+7\n2+8\n2+9\n3+0\n3+1\n3+2\n3+3\n3+4\n3+5\n3+6\n3+7\n3+8\n3+9\n4+0\n4+1\n4+2\n4+3\n4+4\n4+5\n4+6\n4+7\n4+8\n4+9\n5+0\n5+1\n5+2\n5+3\n5+4\n5+5\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs we all know Barney's job is \"PLEASE\" and he has not much to do at work. That's why he started playing \"cups and key\". In this game there are three identical cups arranged in a line from left to right. Initially key... | [{"type": "stdin_stdout", "input": "12\n254904759290707697 475737283258450340 533306428548398547 442127134828578937 779740159015946254 272877594683860919 93000149670491971 632184275887310175 498293278222136720 551099726729989816 149940343283925029 989425634209891686\n", "output": "461895893/385687671\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNauuo is a girl who loves writing comments.\n\nOne day, she posted a comment on Codeforces, wondering whether she would get upvotes or downvotes.\n\nIt's known that there were $x$ persons who would upvote, $y$ persons who... | [{"type": "stdin_stdout", "input": "000 100 100\n", "output": "?\n"}, {"type": "stdin_stdout", "input": "100 100 100\n", "output": "?"}, {"type": "stdin_stdout", "input": "100 100 100\n", "output": "?"}, {"type": "stdin_stdout", "input": "101 0 100\n", "output": "+\n"}, {"type": "stdin_stdout", "input": "25 24 100\n", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe construction of subway in Bertown is almost finished! The President of Berland will visit this city soon to look at the new subway himself.\n\nThere are n stations in the subway. It was built according to the Bertown ... | [{"type": "stdin_stdout", "input": "100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBessie is out grazing on the farm, which consists of $n$ fields connected by $m$ bidirectional roads. She is currently at field $1$, and will return to her home at field $n$ at the end of the day.\n\nThe Cowfederation of ... | [{"type": "stdin_stdout", "input": "42 41 20\n8 34 12 13 38 3 9 10 18 16 2 26 24 17 32 21 4 27 15 39\n1 35\n35 8\n1 31\n31 34\n1 40\n40 12\n1 30\n30 13\n1 33\n33 38\n1 37\n37 3\n1 22\n22 9\n1 20\n20 10\n1 25\n25 18\n1 14\n14 16\n1 42\n42 7\n7 2\n42 11\n11 26\n42 29\n29 24\n42 36\n36 17\n42 41\n41 32\n42 23\n23 21\n42 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a game that uses numbers called \"Fizz Buzz\". In this game, multiple players count the numbers one by one, starting with 1, and each player says only one number after the previous player. At that time, you must ... | [{"type": "stdin_stdout", "input": "5 7\n1\n-1\nFizz\n2\nzuzB\n5\n2\n16 5\n1\n4\n5\n7\n8\n0 0", "output": "3\n1 6 7 8 9 10 11 12 13 14 15 16\n"}, {"type": "stdin_stdout", "input": "14 7\n1\n0\nzzFi\n4\nBuzz\n11\n1\n3 5\n-1\n3\n8\n4\n3\n0 0", "output": "1 4 5 8 9 10 11 12 13 14\n3\n"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nChouti was doing a competitive programming competition. However, after having all the problems accepted, he got bored and decided to invent some small games.\n\nHe came up with the following game. The player has a positiv... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1236540828\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1102703100\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1266106036\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt is said that a legendary treasure left by Mr. Yao is sleeping somewhere in Hachioji long ago. The treasure map, which is said to show its whereabouts, has been handed down by Yao's n descendants, divided into several p... | [{"type": "stdin_stdout", "input": "4\n1 1\n2 0 -1\n2 4 2\n3 2 16 10\n0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n2 0 0\n2 4 2\n3 2 16 10\n0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n2 0 -1\n2 4 2\n3 2 16 2\n0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence $b_1, b_2, \\ldots, b_n$. Find the lexicographically minimal permutation $a_1, a_2, \\ldots, a_{2n}$ such that $b_i = \\min(a_{2i-1}, a_{2i})$, or determine that it is impossible.\n\n\n-----Input-... | [{"type": "stdin_stdout", "input": "1\n100\n49 47 115 100 84 71 77 67 1 39 34 92 72 44 68 124 20 102 187 58 78 41 3 15 14 48 134 11 29 117 45 24 23 19 66 27 7 22 123 55 135 10 149 185 8 9 62 61 137 52 171 2 5 28 43 42 155 6 111 127 17 59 25 126 53 125 103 26 75 12 56 96 148 60 114 13 4 131 101 16 104 51 132 158 18 168 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have an integer sequence of length N: A_0,A_1,\\cdots,A_{N-1}.\n\nFind the following sum (\\mathrm{lcm}(a, b) denotes the least common multiple of a and b):\n\n* \\sum_{i=0}^{N-2} \\sum_{j=i+1}^{N-1} \\mathrm{lcm}(A_i,... | [{"type": "stdin_stdout", "input": "10\n356822 296174 484500 710640 610703 888250 259161 609120 592348 713644", "output": "963903348\n"}, {"type": "stdin_stdout", "input": "10\n356822 296174 484500 710640 231537 888250 259161 609120 592348 713644", "output": "669101188\n"}, {"type": "stdin_stdout", "input": "10\n356822... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou're given a string of lower-case Latin letters. Your task is to find the length of its longest substring that can be met in the string at least twice. These occurrences can overlap (see sample test 2).\n\nInput\n\nThe ... | [{"type": "stdin_stdout", "input": "ipsrjylhpkjvlzncfixipstwcicxqygqcfrawpzzvckoveyqhathglblhpkjvlzncfixipfajaqobtzvthmhgbuawowoknirclxg\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbffffffffffffffffffffffgffffffffffffff\n", "output": "61\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke has four cookies with deliciousness A, B, C, and D. He will choose one or more from those cookies and eat them. Is it possible that the sum of the deliciousness of the eaten cookies is equal to that of the remaining... | [{"type": "stdin_stdout", "input": "45445415 46908390 31865171 30402196\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "93407609 30427494 56229544 81174201\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "76041209 81456309 25817729 23366690\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs Will is stuck in the Upside Down, he can still communicate with his mom, Joyce, through the Christmas lights (he can turn them on and off with his mind). He can't directly tell his mom where he is, because the monster ... | [{"type": "stdin_stdout", "input": ")?(??((???????()?(?????????)??(????????((?)?????)????)??????(?????)?)?????)??????(??()??????)????????)?)()??????????????())????????(???)??)????????????????????(?????)??)???)??(???????????????)???)??)?\n", "output": "8314\n"}, {"type": "stdin_stdout", "input": "?)??)???)??????????????... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIlya plays a card game by the following rules.\n\nA player has several cards. Each card contains two non-negative integers inscribed, one at the top of the card and one at the bottom. At the beginning of the round the pla... | [{"type": "stdin_stdout", "input": "100\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 0\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIgor is in 11th grade. Tomorrow he will have to write an informatics test by the strictest teacher in the school, Pavel Denisovich.\n\nIgor knows how the test will be conducted: first of all, the teacher will give each st... | [{"type": "stdin_stdout", "input": "18\n2 3\n2 3\n2 3\n3 4\n1 4\n3 4\n160570 255604\n3 4\n3 5\n4 5\n1 5\n1 3\n1 2\n1 2\n113836 489816\n1 4\n2 4\n233746 254500\n", "output": "1\n1\n1\n1\n2\n1\n3271\n1\n2\n1\n1\n1\n1\n1\n17237\n2\n2\n3823\n"}, {"type": "stdin_stdout", "input": "14\n1 2\n51649 234369\n3 5\n2 4\n4 5\n2 3\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem\n\nThere are n vertices that are not connected to any of the vertices.\nAn undirected side is stretched between each vertex.\nFind out how many sides can be stretched when the diameter is set to d.\nThe diameter r... | [{"type": "stdin_stdout", "input": "-11 14", "output": "287\n"}, {"type": "stdin_stdout", "input": "-14 17", "output": "449\n"}, {"type": "stdin_stdout", "input": "-11 18", "output": "393\n"}, {"type": "stdin_stdout", "input": "-1 20", "output": "207\n"}, {"type": "stdin_stdout", "input": "-6 11", "output": "128\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe only difference between easy and hard versions is the length of the string.\n\nYou are given a string $s$ and a string $t$, both consisting only of lowercase Latin letters. It is guaranteed that $t$ can be obtained fr... | [{"type": "stdin_stdout", "input": "ziurxtzxixmsmewfuffsqdkpphssdcgybwtmzavkosqtmcntspzvftqybaldjllvgttblectspqinfdhhnpvkcbwjlqlquajueqsgymyekuswjctumsbnvvaiinxjlzcnyixfaykolkeogufvzvhnatqtelgjkqfvexghiznwubwihjkznkhepjzrnyzftmimqtlihpn\nzurzximmewfuffskppsdcybwmzavkosqtmctspvftybaljlgtltsqinfdhhpvkcwjlqlqymykusctumsbn... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit n planets. For planet i ai is the maximum number of suitcases that an alien tourist is allowed to bring to ... | [{"type": "stdin_stdout", "input": "26 919241245\n302193 763904252\n302152 990010704\n453347 786598325\n302156 614790744\n151113 552970041\n151053 935503943\n453339 788648514\n453340 819457698\n604398 992471599\n453342 141598754\n302166 998869126\n151098 158907792\n453293 724150038\n604414 436248800\n604434 447578562\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a program that outputs all leap years between the year a and year b.\n\nThe leap year conditions are as follows. However, 0 <a ≤ b <3,000. If there is no leap year in the given period, output \"NA\".\n\n* The year ... | [{"type": "stdin_stdout", "input": "265 2171\n1686 3636\n2001 2275\n0 0", "output": "268\n272\n276\n280\n284\n288\n292\n296\n304\n308\n312\n316\n320\n324\n328\n332\n336\n340\n344\n348\n352\n356\n360\n364\n368\n372\n376\n380\n384\n388\n392\n396\n400\n404\n408\n412\n416\n420\n424\n428\n432\n436\n440\n444\n448\n452\n456\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRikhail Mubinchik believes that the current definition of prime numbers is obsolete as they are too complex and unpredictable. A palindromic number is another matter. It is aesthetically pleasing, and it has a number of r... | [{"type": "stdin_stdout", "input": "10000 239\n", "output": "1168638\n"}, {"type": "stdin_stdout", "input": "10000 1538\n", "output": "11620"}, {"type": "stdin_stdout", "input": "11275 615\n", "output": "263862"}, {"type": "stdin_stdout", "input": "10100 1538\n", "output": "11940"}, {"type": "stdin_stdout", "input": "1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSimon has a rectangular table consisting of n rows and m columns. Simon numbered the rows of the table from top to bottom starting from one and the columns — from left to right starting from one. We'll represent the cell ... | [{"type": "stdin_stdout", "input": "5 50\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have a set of $n$ discs, the $i$-th disc has radius $i$. Initially, these discs are split among $m$ towers: each tower contains at least one disc, and the discs in each tower are sorted in descending order of their ra... | [{"type": "stdin_stdout", "input": "10 10\n2 10 8 7 9 3 4 6 5 1\n10 4\n10 1\n10 6\n10 8\n10 2\n10 9\n10 7\n10 3\n10 5\n", "output": "9\n9\n9\n8\n7\n6\n6\n4\n2\n0\n"}, {"type": "stdin_stdout", "input": "10 10\n2 10 8 7 9 3 4 6 5 1\n10 4\n10 1\n10 6\n10 8\n10 2\n10 9\n10 7\n10 3\n10 5\n", "output": "9\n9\n9\n8\n7\n6\n6\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have an N \\times N square grid.\nWe will paint each square in the grid either black or white.\nIf we paint exactly A squares white, how many squares will be painted black?\n\n-----Constraints-----\n - 1 \\leq N \\leq ... | [{"type": "stdin_stdout", "input": "19\n100\n", "output": "261\n"}, {"type": "stdin_stdout", "input": "10\n202", "output": "-102\n"}, {"type": "stdin_stdout", "input": "19\n110", "output": "251\n"}, {"type": "stdin_stdout", "input": "10\n-13", "output": "113\n"}, {"type": "stdin_stdout", "input": "10\n-16", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA new pack of n t-shirts came to a shop. Each of the t-shirts is characterized by three integers p_{i}, a_{i} and b_{i}, where p_{i} is the price of the i-th t-shirt, a_{i} is front color of the i-th t-shirt and b_{i} is ... | [{"type": "stdin_stdout", "input": "20\n414468312 20329584 106106409 584924603 666547477 670032002 726095027 276840253 368277336 940941705 531635095 213813062 440421387 959075599 240727854 495316522 838268432 786936631 586382273 806443734\n3 1 2 3 3 2 2 1 3 2 3 2 3 3 3 2 1 3 1 2\n3 1 2 2 2 2 3 1 2 3 2 1 1 2 3 1 2 3 3 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA Garden with Ponds\n\nMr. Gardiner is a modern garden designer who is excellent at utilizing the terrain features. His design method is unique: he first decides the location of ponds and design them with the terrain feat... | [{"type": "stdin_stdout", "input": "3 3\n0 0 2\n0 1 2\n2 3 1\n3 5\n0 3 7 3 3\n4 1 0 2 3\n3 3 4 0 2\n7 7\n2 1 1 1 1 0 0\n1 0 0 0 1 0 0\n1 0 1 1 1 1 1\n1 0 0 0 2 0 1\n1 1 1 1 1 0 1\n0 0 2 1 0 1 1\n0 0 1 1 1 2 -1\n6 6\n1 1 1 1 2 2\n1 0 0 2 0 2\n1 0 -1 2 1 2\n3 3 3 15 13 9\n3 0 0 18 -1 9\n2 6 3 9 9 2\n0 0", "output": "0\n0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA binary matrix is called good if every even length square sub-matrix has an odd number of ones. \n\nGiven a binary matrix $a$ consisting of $n$ rows and $m$ columns, determine the minimum number of cells you need to chan... | [{"type": "stdin_stdout", "input": "2 58\n1100001110010010100001000000000110110001101001100010101110\n1110110010101111001110010001100010001010100011111110110100\n", "output": "27\n"}, {"type": "stdin_stdout", "input": "2 58\n1100001110010010100001000000000110110001101001100010101110\n11101100101011110011100100011000100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have two integers: A and B.\nPrint the largest number among A + B, A - B, and A \\times B.\n\n-----Constraints-----\n - All values in input are integers.\n - -100 \\leq A,\\ B \\leq 100\n\n-----Input-----\nInput is giv... | [{"type": "stdin_stdout", "input": "100 100\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "-96 -16\n", "output": "1536\n"}, {"type": "stdin_stdout", "input": "36 80\n", "output": "2880\n"}, {"type": "stdin_stdout", "input": "-76 39\n", "output": "-37\n"}, {"type": "stdin_stdout", "input": "-13 3\n", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA tourist is visiting Byteland. The tourist knows English very well. The language of Byteland is rather different from English. To be exact it differs in following points:\n\n- Bytelandian alphabet has the same letters as... | [{"type": "stdin_stdout", "input": "5 qwertyuiopasdfghjklzxcvbnm\nPh\nisscP\nBpke_kdc_epclc_jcijsc_mihyo?\nEpcf_kdc_liswhyo_EIED_hy_Vimcvpcn_Zkdvp_siyo_viyecle.\nIpp!", "output": "Hi\nolleH\nWhat are these people doing?\nThey are solving TOTR in Codechef March long contest.\nOhh!\n"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a non-empty string s=s_1s_2... s_n, which consists only of lowercase Latin letters. Polycarp does not like a string if it contains at least one string \"one\" or at least one string \"two\" (or both at the s... | [{"type": "stdin_stdout", "input": "10\nonetwonetwooneooonetwooo\ntwo\none\ntwooooo\nttttwo\nttwwoo\nooone\nonnne\noneeeee\noneeeeeeetwooooo\n", "output": "6\n2 6 10 13 18 21 \n1\n2 \n1\n2 \n1\n2 \n1\n5 \n0\n\n1\n4 \n0\n\n1\n2 \n2\n2 11 \n"}, {"type": "stdin_stdout", "input": "10\nonetwonetwooneooonetwooo\ntwo\none\ntw... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe postal system in the area where Masa lives has changed a bit. In this area, each post office is numbered consecutively from 1 to a different number, and mail delivered to a post office is intended from that post offic... | [{"type": "stdin_stdout", "input": "4 5\n1 2 10\n1 3 15\n2 3 5\n2 4 3\n3 4 10\n2\n1 4 10 LoveLetter\n2 3 13 Greetings\n3 3\n1 2 1\n2 3 1\n3 1 1\n3\n1 2 1 BusinessMailC\n2 3 1 BusinessMailB\n3 1 1 BusinessMailA\n0 0", "output": "Greetings 18\nLoveLetter 26\n\nBusinessMailA 2\nBusinessMailB 2\nBusinessMailC 2\n"}, {"type... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nShuseki Kingdom is the world's leading nation for innovation and technology. There are n cities in the kingdom, numbered from 1 to n.\n\nThanks to Mr. Kitayuta's research, it has finally become possible to construct telep... | [{"type": "stdin_stdout", "input": "7 13\n6 1\n7 2\n3 7\n6 5\n3 6\n7 4\n3 5\n4 1\n3 1\n1 5\n1 6\n6 2\n2 4\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "8 12\n6 1\n7 5\n2 5\n4 1\n6 3\n4 3\n5 7\n1 3\n5 2\n2 7\n4 6\n7 2\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "8 12\n6 1\n7 5\n2 5\n4 1\n6 3\n4 3\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHaving stayed home alone, Petya decided to watch forbidden films on the Net in secret. \"What ungentlemanly behavior!\" — you can say that, of course, but don't be too harsh on the kid. In his country films about the Mart... | [{"type": "stdin_stdout", "input": "000:0010\n", "output": "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 "}, {"type": "stdin_stdout", "input": "001:010\n", "output": "2 3 4 5 6 7 8 9 10 11 12 13 14 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMy arm is stuck and I can't pull it out.\n\nI tried to pick up something that had rolled over to the back of my desk, and I inserted my arm while illuminating it with the screen of my cell phone instead of a flashlight, b... | [{"type": "stdin_stdout", "input": "1\n11\n111111\n111111111111\n12345\n11111111119999999999\n11111111113333333333\n11111111118888888888\n11111111112222222222111111111\n11111111110000000000444444444\n11224111122411\n888888888888999999999999888888888888999999999999999999\n666666666666666777333333333338888888888\n1111114... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nDuring this time of winter in Japan, hot days continue in Australia in the Southern Hemisphere. IOI, who lives in Australia, decided to plan what clothes to wear based on the weather forecast for a certain D da... | [{"type": "stdin_stdout", "input": "3 4\n31\n27\n35\n20 25 30\n23 29 90\n21 35 60\n28 48 40", "output": "100\n"}, {"type": "stdin_stdout", "input": "3 4\n31\n27\n35\n20 25 30\n23 29 90\n21 35 60\n28 48 25", "output": "130\n"}, {"type": "stdin_stdout", "input": "3 4\n34\n40\n44\n38 25 30\n24 29 11\n21 69 99\n28 43 40", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nStudent Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph — something that will definitely never be useful in real life. He asked a girl sitti... | [{"type": "stdin_stdout", "input": "10 15\n900000001 1\n900000001 1\n900000002 1\n1737646700 1\n900000001 0\n900000001 1\n900000001 0\n900000001 0\n900000001 0\n900000001 1\n900000001 0\n900000001 0\n900000004 1\n900000000 1\n900000001 1\n", "output": "1 3\n1 4\n1 8\n1 10\n2 3\n1 5\n2 4\n3 4\n2 5\n1 6\n3 5\n4 5\n1 9\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYura has been walking for some time already and is planning to return home. He needs to get home as fast as possible. To do this, Yura can use the instant-movement locations around the city.\n\nLet's represent the city as... | [{"type": "stdin_stdout", "input": "995078784 16\n623812784 347467913 233267735 582455459\n355611107 277980472\n78770458 786182235\n815219022 611815511\n786044046 363376661\n290398527 1777289213\n846155104 388600335\n143085949 155695413\n287078777 918827034\n432395923 126620751\n52941102 329010981\n237509699 571287936\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nUser ainta is making a web site. This time he is going to make a navigation of the pages. In his site, there are n pages numbered by integers from 1 to n. Assume that somebody is on the p-th page now. The navigation will ... | [{"type": "stdin_stdout", "input": "100 10 100\n", "output": "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 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Alyona is celebrating Happy Birthday! Her mother has an array of n flowers. Each flower has some mood, the mood of i-th flower is a_{i}. The mood can be positive, zero or negative.\n\nLet's define a subarray as a s... | [{"type": "stdin_stdout", "input": "86 30\n16 -12 11 16 8 14 7 -29 18 30 -32 -10 20 29 -14 -21 23 -19 -15 17 -2 25 -22 2 26 15 -7 -12 -4 -28 21 -4 -2 22 28 -32 9 -20 23 38 -21 21 37 -13 -30 25 31 6 18 29 29 29 27 38 -15 -32 32 -7 -8 -33 -11 24 23 -19 -36 -36 -18 9 -1 32 -34 -26 1 -1 -16 -14 17 -17 15 -24 38 5 -27 -12 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMainak has an array $a_1, a_2, \\ldots, a_n$ of $n$ positive integers. He will do the following operation to this array exactly once:\n\nPick a subsegment of this array and cyclically rotate it by any amount.\n\nFormally,... | [{"type": "stdin_stdout", "input": "50\n1\n999\n1\n998\n1\n997\n1\n996\n1\n995\n1\n994\n1\n993\n1\n992\n1\n991\n1\n990\n1\n989\n1\n988\n1\n987\n1\n986\n1\n985\n1\n984\n1\n983\n1\n982\n1\n981\n1\n980\n1\n979\n1\n978\n1\n977\n1\n976\n1\n975\n1\n974\n1\n973\n1\n972\n1\n971\n1\n970\n1\n969\n1\n968\n1\n967\n1\n966\n1\n965\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya has n items lying in a line. The items are consecutively numbered by numbers from 1 to n in such a way that the leftmost item has number 1, the rightmost item has number n. Each item has a weight, the i-th item weig... | [{"type": "stdin_stdout", "input": "2 100 100 10000 10000\n100 100\n", "output": "20000\n"}, {"type": "stdin_stdout", "input": "2 100 100 10000 10000\n100 100\n", "output": "20000\n"}, {"type": "stdin_stdout", "input": "2 100 100 00000 10000\n100 100\n", "output": "20000\n"}, {"type": "stdin_stdout", "input": "2 100 10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the spirit of the holidays, Saitama has given Genos two grid paths of length n (a weird gift even by Saitama's standards). A grid path is an ordered sequence of neighbouring squares in an infinite grid. Two squares are... | [{"type": "stdin_stdout", "input": "200\nNESENEESEESWWWNWWSWSWNWNNWNNESWSWNNWNWNENESENNESSWSESWWSSSEEEESSENNNESSWWSSSSESWSWWNNEESSWWNNWSWSSWWNWNNEENNENWWNESSSENWNESWNESWNESEESSWNESSSSSESESSWNNENENESSWWNNWWSWWNESEENWWWWNWWNWWNENESESSWWSWWSES\nNWNESESSENNNESWNWWSWWWNWSESSSWWNWWNNWSENWSWNENNNWWSWWSWNNNESWWWSSESSWWWSSENWSE... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBeroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.\n\nBeroffice works only with small English letters (... | [{"type": "stdin_stdout", "input": "bddabcdfaccdabcdfadddabcdfabbdabcdfacddabcdfacdbabcdfacbbabcdfacbcabcdfacbdabcdfadbbabcdfabdbabcdfabdcabcdfabbcabcdfabccabcdfabbbabcdfaddcabcdfaccbabcdfadbdabcdfacccabcdfadcdabcdfadcbabcdfabcbabcdfadbcabcdfacdcabcdfabcdabcdfadccabcdfaddb\n", "output": "bd dabc dfacc dabc dfadddabc df... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA string a of length m is called antipalindromic iff m is even, and for each i (1 ≤ i ≤ m) a_{i} ≠ a_{m} - i + 1.\n\nIvan has a string s consisting of n lowercase Latin letters; n is even. He wants to form some string t t... | [{"type": "stdin_stdout", "input": "100\nadebebcdacabaadcbcdebcccdaadaeeedecdbcbdeddcbcaeedbecaeeabaabbdccaebdebabbabdcebbbdaabdbddcadaddadad\n52 62 28 18 100 84 16 53 43 52 49 92 10 64 50 95 90 52 21 14 60 3 94 63 31 70 74 62 93 75 100 96 58 36 76 40 62 74 91 77 92 78 65 11 50 18 79 29 10 25 4 24 44 39 4 91 81 63 97 6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPermutation p is an ordered set of integers p_1, p_2, ..., p_{n}, consisting of n distinct positive integers, each of them doesn't exceed n. We'll denote the i-th element of permutation p as p_{i}. We'll call number n ... | [{"type": "stdin_stdout", "input": "100\n-77 57 -95 -23 53 -29 82 -83 38 -73 85 28 25 6 -16 4 -10 -30 -9 -92 14 34 -93 61 36 -100 90 -68 28 16 100 -4 49 23 36 -87 62 -62 53 74 -50 -2 102 8 22 -30 -19 83 7 84 43 90 -65 -75 -15 97 90 15 66 2 13 -91 91 -44 62 51 51 -58 95 77 20 45 76 79 91 60 76 2 82 42 -130 94 -70 122 65... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA permutation is a sequence of integers p_1, p_2, ..., p_{n}, consisting of n distinct positive integers, each of them doesn't exceed n. Let's denote the i-th element of permutation p as p_{i}. We'll call number n the siz... | [{"type": "stdin_stdout", "input": "102\n", "output": "2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 26 25 28 27 30 29 32 31 34 33 36 35 38 37 40 39 42 41 44 43 46 45 48 47 50 49 52 51 54 53 56 55 58 57 60 59 62 61 64 63 66 65 68 67 70 69 72 71 74 73 76 75 78 77 80 79 82 81 84 83 86 85 88 87 90 89 92 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nN friends of Takahashi has come to a theme park.\nTo ride the most popular roller coaster in the park, you must be at least K centimeters tall.\nThe i-th friend is h_i centimeters tall.\nHow many of the Takahashi's friend... | [{"type": "stdin_stdout", "input": "81 358\n59 53 2 54 462 325 435 279 464 327 49 332 95 200 220 158 139 492 130 467 489 458 81 100 466 473 429 275 81 270 455 218 128 307 335 398 52 30 311 69 148 384 454 413 114 315 186 334 382 392 326 8 53 462 457 350 231 61 185 88 305 480 64 390 52 247 443 240 93 469 370 16 443 7 25 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya is choosing a laptop. The shop has n laptops to all tastes.\n\nVasya is interested in the following properties: processor speed, ram and hdd. Vasya is a programmer and not a gamer which is why he is not interested i... | [{"type": "stdin_stdout", "input": "27\n1689 1927 40 270\n3833 2570 167 134\n2580 3589 390 300\n1898 2587 407 316\n1841 2772 411 187\n1296 288 407 506\n1215 263 236 307\n2737 1427 84 992\n1107 1879 284 866\n3311 2507 475 147\n2951 2214 209 375\n1352 2582 110 324\n2082 747 289 521\n2226 1617 209 108\n2253 1993 109 835\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA programming competition site AtCode regularly holds programming contests.\nThe next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.\nThe contest after the ABC is called ARC, ... | [{"type": "stdin_stdout", "input": "1199\n", "output": "ABC\n"}, {"type": "stdin_stdout", "input": "1200\n", "output": "ARC\n"}, {"type": "stdin_stdout", "input": "4208\n", "output": "AGC\n"}, {"type": "stdin_stdout", "input": "1234\n", "output": "ARC\n"}, {"type": "stdin_stdout", "input": "2799\n", "output": "ARC\n"},... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.