messages listlengths 1 1 | ground_truth stringlengths 156 726k | dataset stringclasses 2
values |
|---|---|---|
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou want to make change for $ n $ cents. Assuming that you have infinite supply of coins of 1, 5, 10 and / or... | [{"input": "251195", "output": "10049\n"}, {"input": "467454", "output": "18702\n"}, {"input": "698278", "output": "27934\n"}, {"input": "323456", "output": "12940\n"}, {"input": "164898", "output": "6600\n"}, {"input": "122288", "output": "4895\n"}, {"input": "111927", "output": "4479\n"}, {"input": "163537", "output"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given strings s and t, consisting of lowercase English letters.\nYou will create a string s' by freel... | [{"input": "ratcode\natlas\n", "output": "Yes\n"}, {"input": "ratcode\nsalta", "output": "Yes\n"}, {"input": "ratcode\nsalt`", "output": "Yes\n"}, {"input": "rdtcoae\nsalt`", "output": "Yes\n"}, {"input": "eaoctdr\nsalt`", "output": "Yes\n"}, {"input": "rdtcoae\nsalta", "output": "Yes\n"}, {"input": "rdtcoae\natlas", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis year in Equestria was a year of plenty, so Applejack has decided to build some new apple storages. Accor... | [{"input": "1\n1\n34\n- 1\n+ 1\n+ 1\n+ 1\n+ 1\n+ 1\n+ 1\n+ 1\n+ 1\n+ 1\n- 1\n- 1\n- 1\n- 1\n- 1\n+ 2\n+ 2\n+ 2\n+ 2\n- 1\n+ 2\n+ 2\n- 1\n+ 2\n- 1\n+ 3\n+ 3\n+ 1\n- 1\n- 2\n- 2\n- 2\n+ 1\n+ 3\n", "output": "NO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nYES\nYES\nNO\nNO\nYES... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour task is to shuffle a deck of n cards, each of which is marked by a alphabetical letter.\n\nA single shuf... | [{"input": "caaa\n3\n1\n-1\n2\nvwxyz\n2\n3\n4\n-", "output": "aaca\nxyzvw\n"}, {"input": "caaa\n3\n1\n-2\n2\nwwxyz\n2\n3\n4\n-", "output": "aaac\nxyzww\n"}, {"input": "caaa\n3\n1\n-2\n2\nwwxyz\n2\n4\n4\n-", "output": "aaac\nyzwwx\n"}, {"input": "caaa\n3\n0\n0\n2\nvxxyz\n2\n1\n10\n-", "output": "aaca\nxxyzv\n"}, {"input... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\nYou are given two integer a... | [{"input": "2\n2 2\n2 2\n-4 6\n3 9\n1 2 -3\n-2 -1 -4", "output": "16\n44\n"}, {"input": "2\n2 4\n0 2\n-1 10\n3 3\n1 2 -3\n-4 3 -5", "output": "60\n32\n"}, {"input": "2\n2 4\n0 2\n-1 10\n3 1\n1 2 -3\n-4 3 -5", "output": "60\n22\n"}, {"input": "2\n2 4\n0 2\n-1 10\n3 1\n1 3 -3\n-4 3 -5", "output": "60\n25\n"}, {"input": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour friend is developing a computer game. He has already decided how the game world should look like β it sh... | [{"input": "50 72\n35 38\n19 46\n35 12\n27 30\n23 41\n50 16\n31 6\n20 33\n38 1\n10 35\n13 43\n29 25\n25 4\n1 13\n4 20\n36 29\n13 47\n48 5\n30 21\n30 38\n28 50\n41 45\n25 43\n40 36\n19 47\n31 32\n26 28\n8 13\n43 24\n27 35\n14 29\n14 38\n50 9\n34 49\n12 34\n43 42\n41 15\n46 29\n48 11\n48 7\n40 29\n48 21\n18 26\n15 11\n12... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSometimes Mister B has free evenings when he doesn't know what to do. Fortunately, Mister B found a new game,... | [{"input": "12 12 876543210 1000000000\n", "output": "13\n"}, {"input": "12 12 876543210 1000000000\n", "output": "13"}, {"input": "10 12 220000011 220000032\n", "output": "11\n"}, {"input": "5 10 1000000000 1000000000\n", "output": "1\n"}, {"input": "11 3 378541409 1077499882\n", "output": "19\n"}, {"input": "10 12 22... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n<image>\n\n\nThere used to be a game called Joseph's potatoes. Let's say n people are participating. Particip... | [{"input": "44 3\n45 10\n0 0", "output": "40\n33\n"}, {"input": "75 2\n16 14\n0 0", "output": "23\n10\n"}, {"input": "18 3\n45 10\n0 0", "output": "14\n33\n"}, {"input": "26 3\n45 10\n0 0", "output": "17\n33\n"}, {"input": "75 2\n16 17\n0 0", "output": "23\n12\n"}, {"input": "13 2\n16 17\n0 0", "output": "11\n12\n"}, {... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a straight snowy road, divided into n blocks. The blocks are numbered from 1 to n from left to right... | [{"input": "17\n.......RRRRR.....\n", "output": "8 13\n"}, {"input": "17\n.....RRRRR.......\n", "output": "6 11\n"}, {"input": "17\n......RRRRR......\n", "output": "7 12\n"}, {"input": "13\n....LLLLLL...\n", "output": "10 4\n"}, {"input": "13\n...LLLLLL....\n", "output": "9 3\n"}, {"input": "11\n.RRRLLLLL..\n", "output... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have a new professor of graph theory and he speaks very quickly. You come up with the following plan to k... | [{"input": "10 22\nazbrll oen\ngh vdyayei\njphveblohx vfglv\nmfyxib jepnvhcuwo\nrpikazqj uam\nl rx\nokjenof qpnyi\nj tixqrno\nod itozmfct\nikkdxmirx ev\nqexftojc p\nkdazb zjs\nmbk ykvqjrxaxu\nhbcwhouzq pwt\nmirpsz zfaegpl\nuhkkvcj rlvwj\nef iqnnwtolrc\npjzfcpmeag ecdayth\nsa qcthz\ncbfhfxi qrnbvdryz\nwqel tj\natx smkbi... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a function to calculate compound tax using the following table:\n\nFor $10 and under, the tax rate shou... | [{"input": "1000000", "output": "[30001.3]", "fn_name": "tax_calculator"}, {"input": "30.49", "output": "[2.21]", "fn_name": "tax_calculator"}, {"input": "\"monkey\"", "output": "[0]", "fn_name": "tax_calculator"}, {"input": "11", "output": "[1.07]", "fn_name": "tax_calculator"}, {"input": "15", "output": "[1.35]", "fn... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn music, if you double (or halve) the pitch of any note you will get to the same note again.\n\n\"Concert A\... | [{"input": "261.625", "output": "[\"C\"]", "fn_name": "get_note"}, {"input": "523.25", "output": "[\"C\"]", "fn_name": "get_note"}, {"input": "1046.5", "output": "[\"C\"]", "fn_name": "get_note"}, {"input": "440", "output": "[\"A\"]", "fn_name": "get_note"}, {"input": "220", "output": "[\"A\"]", "fn_name": "get_note"},... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIβm planning to have a party on my birthday. Many of my friends will come to the party. Some of them will com... | [{"input": "0 5\n11 7 4 -1 15", "output": "36\n"}, {"input": "0 1\n15 0 -1 -1 1", "output": "15\n"}, {"input": "0 1\n45 -3 -1 1 2", "output": "45\n"}, {"input": "0 2\n56 -3 -1 1 2", "output": "53\n"}, {"input": "0 5\n11 7 4 0 15", "output": "37\n"}, {"input": "0 1\n11 7 4 0 15", "output": "11\n"}, {"input": "0 3\n-2 97... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N bags, each containing two white balls. The i-th box contains two balls with integers x_i and y_i ... | [{"input": "2\n1 1\n1000000000 1000000000\n", "output": "999999998000000001\n"}, {"input": "2\n1 1\n1000000000 1000000100", "output": "1000000097999999901\n"}, {"input": "2\n1 1\n1000000000 1000100100", "output": "1000100097999899901\n"}, {"input": "2\n1 1\n1100000000 1000000000", "output": "1099999997900000001\n"}, {"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMoamen and Ezzat are playing a game. They create an array $a$ of $n$ non-negative integers where every elemen... | [{"input": "5\n200000 200000\n200000 200000\n200000 200000\n200000 200000\n200000 200000\n", "output": "226490044\n226490044\n226490044\n226490044\n226490044\n"}, {"input": "5\n200000 200000\n200000 200000\n200000 200000\n200000 200000\n200000 200000\n", "output": "226490044\n226490044\n226490044\n226490044\n226490044\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n - First, choose a pos... | [{"input": "1000000000000\n", "output": "8\n"}, {"input": "200560490130\n", "output": "11\n"}, {"input": "755827200000\n", "output": "10\n"}, {"input": "366735600000\n", "output": "10\n"}, {"input": "997764507000\n", "output": "7\n"}, {"input": "549755813888\n", "output": "8\n"}, {"input": "999999999989\n", "output": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn the evening Polycarp decided to analyze his today's travel expenses on public transport.\n\nThe bus system... | [{"input": "27 8 1 0 1\nBcd A\nA b\nb BcDc\ndc dbaC\ndbaC dcCB\nB d\nd BbAc\nCBC b\nDBDca d\ncAbb AA\nAA Ba\ncAccb DBDca\ncb DdaB\nAAcBc Ba\nBa dc\ndc DDCd\nbcBDA da\nbDD ADD\nAA b\nb cb\ncb CCBbd\nCCBbd bcDdb\nbcDdb ddc\nddc C\nC Adc\nAdc BbAc\nBbAc DD\n", "output": "111\n"}, {"input": "27 8 1 0 1\nBcd A\nA b\nb BcDc\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEvlampiy has found one more cool application to process photos. However the application has certain limitatio... | [{"input": "101 9\n3 2 2 1 4 1 3 2 3 4 3 2 3 1 4 4 1 1 4 1 3 3 4 1 2 1 1 3 1 2 2 4 3 1 4 3 1 1 4 4 1 2 1 1 4 2 3 4 1 2 1 4 4 1 4 3 1 4 2 1 2 1 4 3 4 3 4 2 2 4 3 2 1 3 4 3 2 2 4 3 3 2 4 1 3 2 2 4 1 3 4 2 1 3 3 2 2 1 1 3 1\n", "output": "0\n"}, {"input": "101 9\n3 2 2 1 4 1 3 2 3 4 3 2 3 1 4 4 1 1 4 1 3 3 4 1 2 1 1 3 1 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVladimir would like to prepare a present for his wife: they have an anniversary! He decided to buy her exactl... | [{"input": "1\n7 7\n873108721 195635452\n42649954 997221147\n873108721 1003477544\n1087176458 873108721\n1130734166 858693746\n1309378041 372607189\n1000000000 427003887\n", "output": "7410830018\n"}, {"input": "1\n7 7\n873108721 195635452\n66631086 997221147\n1700956320 1570665517\n1087176458 779474384\n596405150 5023... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \nZombies zombies everywhere!!Β ... | [{"input": "2\n2 6\n16 17", "output": "30\n118740505\n"}, {"input": "2\n2 6\n19 17", "output": "30\n361105078\n"}, {"input": "2\n2 6\n29 17", "output": "30\n684841218\n"}, {"input": "2\n2 6\n19 34", "output": "30\n525446287\n"}, {"input": "2\n3 6\n9 17", "output": "150\n14443521\n"}, {"input": "2\n1 6\n16 17", "output"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hou... | [{"input": "71983", "output": "19:59:43\n"}, {"input": "-1025", "output": "-1:42:55\n"}, {"input": "-144", "output": "-1:57:36\n"}, {"input": "-274", "output": "-1:55:26\n"}, {"input": "-399", "output": "-1:53:21\n"}, {"input": "-694", "output": "-1:48:26\n"}, {"input": "-650", "output": "-1:49:10\n"}, {"input": "-469"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given four integer values $a$, $b$, $c$ and $m$.\n\nCheck if there exists a string that contains:\n\n... | [{"input": "3\n2 2 1 0\n2 1 1 1\n1 2 3 2\n", "output": "YES\nYES\nYES\n"}, {"input": "3\n2 2 1 0\n1 1 1 1\n1 2 3 2\n", "output": "YES\nNO\nYES\n"}, {"input": "3\n3 2 1 0\n1 1 1 1\n1 2 3 2\n", "output": "YES\nNO\nYES\n"}, {"input": "3\n3 2 1 0\n1 1 1 1\n1 2 3 3\n", "output": "YES\nNO\nYES\n"}, {"input": "3\n2 2 1 0\n1 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour mission in this problem is to write a computer program that manipulates molecular for- mulae in virtual ... | [{"input": "H 1\neI 5\nC 12\nO 16\nF 22\nNe 24\nEu 64\nCc 241\nEND_OF_FIRST_PART\nG2C\n(MhF)2As\nCu(OH)2\nH((CO)2F)99\n0", "output": "UNKNOWN\nUNKNOWN\nUNKNOWN\n7723\n"}, {"input": "H 0\nHe 4\nC 12\nO 26\nF 2\nOe 36\nvC 64\nCc 603\nEND_OF_FIRST_PART\nH2B\n(MgF)2As\nBu(OH)2\nH((CO)2F)99\n0", "output": "UNKNOWN\nUNKNOWN\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nValera is a lazy student. He has m clean bowls and k clean plates. \n\nValera has made an eating plan for the... | [{"input": "233 100 1\n2 2 1 1 1 2 2 2 2 1 1 2 2 2 1 2 2 1 1 1 2 2 1 1 1 1 2 1 2 2 1 1 2 2 1 2 2 1 2 1 2 1 2 2 2 1 1 1 1 2 1 2 1 1 2 1 1 2 2 1 2 1 2 1 1 1 1 1 1 1 1 1 2 1 2 2 2 1 1 2 2 1 1 1 1 2 1 1 2 1 2 2 2 1 1 1 2 2 2 1 1 1 1 2 1 2 1 1 1 1 2 2 2 1 1 2 1 2 1 1 1 1 1 2 1 1 1 1 1 2 1 1 2 2 1 2 1 1 2 2 1 1 2 2 1 1 1 2 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are making your very own boardgame. The game is played by two opposing players, featuring a 6 x 6 tile sy... | [{"input": "\"k\"\n\"A\"", "output": "[\"k\"]", "fn_name": "fight_resolve"}, {"input": "\"K\"\n\"a\"", "output": "[\"K\"]", "fn_name": "fight_resolve"}, {"input": "\"K\"\n\"A\"", "output": "[-1]", "fn_name": "fight_resolve"}, {"input": "\"S\"\n\"A\"", "output": "[-1]", "fn_name": "fight_resolve"}, {"input": "\"k\"\n\"s... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for... | [{"input": "4 13 400 600\n13 30\n1 19\n1 160\n1 113\n58 73 15 319 194 362 128 157 336 162 77 90 96\n", "output": "1\n"}, {"input": "4 13 400 600\n13 30\n1 19\n1 160\n1 113\n58 73 15 319 209 362 128 157 336 162 77 90 96\n", "output": "1\n"}, {"input": "4 13 400 600\n13 30\n1 19\n2 160\n1 113\n58 73 15 319 209 362 128 15... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBurenka came to kindergarden. This kindergarten is quite strange, so each kid there receives two fractions ($... | [{"input": "7\n1000000000 999999999 999999999 999999998\n999999997 999999996 999999996 999999995\n999999994 999999993 999999993 999999992\n999999991 999999990 999999990 999999989\n999999988 999999987 999999987 999999986\n999999985 999999984 999999984 999999983\n999999982 999999981 999999981 999999980\n", "output": "2\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nShuseki Kingdom is the world's leading nation for innovation and technology. There are n cities in the kingdo... | [{"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\n4 2\n2 4\n", "output": "7\n"}, {"input": "7 13\n6 1\n7 2\n3 7\n6 5\n3 6\n7 4\n3 7\n4 1\n3 1\n1 5\n1 6\n4 2\n2 4\n", "output": "7\n"}, {"input": "7 13\n6 1\n7 2\n3 7\n6 5\n3 6\n7 4\n3 4\n4 1\n3 1\n1 5\n1 6\n4 2\n2 4\n", "output": "7\n"}, {"input": ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFind the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, ... | [{"input": "80 100\n", "output": "1000\n"}, {"input": "68 85\n", "output": "850\n"}, {"input": "24 30\n", "output": "300\n"}, {"input": "25 32\n", "output": "320\n"}, {"input": "27 34\n", "output": "340\n"}, {"input": "56 71\n", "output": "710\n"}, {"input": "58 72\n", "output": "725\n"}, {"input": "34 43\n", "output":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEvery year, hundreds of people come to summer camps, they learn new algorithms and solve hard problems.\n\nTh... | [{"input": "1000\n", "output": "3\n"}, {"input": "1000\n", "output": "3\n"}, {"input": "999\n", "output": "9\n"}, {"input": "100\n", "output": "5\n"}, {"input": "123\n", "output": "6\n"}, {"input": "157\n", "output": "3\n"}, {"input": "289\n", "output": "1\n"}, {"input": "179\n", "output": "4\n"}, {"input": "942\n", "o... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA sequence a0, a1, ..., at - 1 is called increasing if ai - 1 < ai for each i: 0 < i < t.\n\nYou are given a ... | [{"input": "100 3\n329 226 331 909 962 112 837 1005 194 818 506 416 125 648 367 459 400 582 989 547 329 438 234 121 272 226 821 376 834 427 718 164 834 113 654 177 737 212 169 696 744 180 89 944 233 147 667 990 809 1072 1085 1093 814 265 1067 312 833 572 303 901 1032 504 185 817 389 158 613 723 239 269 911 352 769 404 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAtCoDeer the deer recently bought three paint cans.\nThe color of the one he bought two days ago is a, the co... | [{"input": "11 12 -1", "output": "3\n"}, {"input": "11 20 -1", "output": "3\n"}, {"input": "3 3 33\n", "output": "2\n"}, {"input": "5 -1 33", "output": "3\n"}, {"input": "5 -2 33", "output": "3\n"}, {"input": "3 17 -1", "output": "3\n"}, {"input": "3 12 -1", "output": "3\n"}, {"input": "6 12 -1", "output": "3\n"}, {"in... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPeter Parker wants to play a game with Dr. Octopus. The game is about cycles. Cycle is a sequence of vertices... | [{"input": "10\n1378238141 598196518 640274071 983359971 23484317 96204862 799843967 446173607 613537551 402690754\n", "output": "2\n1\n1\n1\n1\n2\n2\n2\n2\n1\n"}, {"input": "10\n1378238141 870151580 640274071 983359971 42771579 67907111 799843967 446173607 613537551 402690754\n", "output": "2\n1\n1\n1\n1\n1\n1\n1\n1\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N towns on a plane. The i-th town is located at the coordinates (x_i,y_i). There may be more than o... | [{"input": "6\n7 0\n0 4\n14 51\n2 1\n19 4\n4 20", "output": "10\n"}, {"input": "6\n1 -1\n4 5\n14 54\n1 2\n38 0\n4 5", "output": "14\n"}, {"input": "6\n7 0\n0 5\n14 31\n2 1\n19 4\n4 20", "output": "11\n"}, {"input": "6\n7 0\n0 5\n14 51\n2 1\n19 4\n4 20", "output": "11\n"}, {"input": "6\n13 0\n0 4\n14 51\n2 1\n19 4\n4 20... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou've decided to carry out a survey in the theory of prime numbers. Let us remind you that a prime number is... | [{"input": "100000 1000000 7821\n", "output": "108426\n"}, {"input": "10000 1000000 60000\n", "output": "793662\n"}, {"input": "10000 1000000 60000\n", "output": "793662"}, {"input": "100000 1000000 7821\n", "output": "108426"}, {"input": "100000 1000000 8225\n", "output": "114000"}, {"input": "100001 1000000 8225\n", ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOleg the client and Igor the analyst are good friends. However, sometimes they argue over little things. Rece... | [{"input": "tinkoff\nzscoder\n", "output": "fzfsirk\n"}, {"input": "tinkoff\nzscoder\n", "output": "fzfsirk\n"}, {"input": "tinkogf\nzscoder\n", "output": "fzgsirk"}, {"input": "thnkogf\nzscoder\n", "output": "fzgshrk"}, {"input": "ffoknht\nzscoder\n", "output": "fzfshrk"}, {"input": "ffojnht\nzscoder\n", "output": "fz... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya likes to solve equations. Today he wants to solve $(x~\\mathrm{div}~k) \\cdot (x \\bmod k) = n$, where ... | [{"input": "999983 1000\n", "output": "999983001\n"}, {"input": "999995 1000\n", "output": "199999005\n"}, {"input": "1709131 435\n", "output": "743471986\n"}, {"input": "232207 1179\n", "output": "273772054\n"}, {"input": "652411 1010\n", "output": "658935111\n"}, {"input": "1000000 1000\n", "output": "1250800\n"}, {"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle C loves number Β«3Β» very much. He loves all things about it.\n\nNow he has a positive integer $n$. He w... | [{"input": "1582786060\n", "output": "1 1 1582786058\n"}, {"input": "1000100000\n", "output": "1 2 1000099997\n"}, {"input": "1000071476\n", "output": "1 2 1000071473\n"}, {"input": "1042579470\n", "output": "1 1 1042579468\n"}, {"input": "1187564933\n", "output": "1 2 1187564930\n"}, {"input": "1455962944\n", "output"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe R1 company wants to hold a web search championship. There were n computers given for the competition, eac... | [{"input": "80 50\n15160 6853 20254 11358 19535 27691 2983 31650 9219 11833 32053 31695 21511 4320 4384 24843 1454 31543 18796 13815 1546 27926 16276 14315 12542 25370 24890 29647 3584 17867 12446 15072 19852 30207 16361 7964 5343 398 10837 31114 9252 12767 15098 22562 32637 31823 8160 12658 6422 19142 12448 6765 7373 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nProblem\n\nMr. ukuku1333 is a little sloppy, so when I expanded the product of the linear expressions of x, I... | [{"input": "x^5+15x^4+85x^3+225x^2+274x+120", "output": "(x+1)(x+2)(x+3)(x+4)(x+5)"}, {"input": "x^3-81x^2-1882x-1800", "output": "(x-100)(x+1)(x+18)"}, {"input": "x^2+4x+3", "output": "(x+1)(x+3)\n"}, {"input": "x^2+3x+2", "output": "(x+1)(x+2)"}, {"input": "x^2-4", "output": "(x-2)(x+2)\n"}, {"input": "x^2-4", "outpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWhen a boy was cleaning up after his grand father passing, he found an old paper:\n\n<image>\n\n\n\nIn additi... | [{"input": "56,65\n97,54\n64,-4\n55,76\n42,-27\n43,80\n87,-86\n55,-6\n89,34\n5,59\n0,0", "output": "181\n-212\n"}, {"input": "56,65\n97,54\n64,-4\n55,76\n42,-27\n43,80\n77,-86\n55,-6\n89,34\n95,5\n0,0", "output": "180\n-297\n"}, {"input": "56,65\n97,54\n64,-4\n65,76\n42,-27\n43,80\n77,-86\n55,-6\n89,34\n95,5\n0,0", "ou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nProblem Statement\n\n\"Everlasting -One-\" is an award-winning online game launched this year. This game has ... | [{"input": "12 2\n2 2\n4 12\n6 0\n100000 0\n0 0", "output": "2049\n64\n607723520\n"}, {"input": "12 2\n1 2\n4 3\n6 0\n100000 0\n0 0", "output": "1025\n64\n607723520\n"}, {"input": "12 2\n2 2\n4 3\n6 0\n100000 0\n0 0", "output": "2049\n64\n607723520\n"}, {"input": "4 0\n4 1\n2 3\n7 0\n100000 0\n0 0", "output": "16\n9\n1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne day Vasya got hold of information on the Martian dollar course in bourles for the next n days. The buying... | [{"input": "93 867\n131 1270 616 1027 1685 27 1662 947 1480 20 1394 1528 191 1348 37 1694 1772 1706 1394 49 1391 878 1474 307 101 1129 1064 116 143 1239 261 651 1534 1348 1604 636 793 1188 1293 36 1729 1204 1656 1579 1644 661 1470 341 1709 1860 1081 1539 5 1892 1732 1049 419 25 1086 1263 967 1284 1229 1013 1348 1046 92... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nToad Rash has a binary string s. A binary string consists only of zeros and ones.\n\nLet n be the length of s... | [{"input": "1101111000011110111111110101100111111110111100001111011010111001101100010110000001010101101010111000\n", "output": "4672\n"}, {"input": "1101111000011110111111110101100111111110111100001111011010111001101100010110000001010101101010101000\n", "output": "4669\n"}, {"input": "1101111000001110111111110101100011... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTo get money for a new aeonic blaster, ranger Qwerty decided to engage in trade for a while. He wants to buy ... | [{"input": "5 10 15\nDdunkjly\n13 12 4\n83 26 1\n63 42 3\n83 22 2\n57 33 0\n59 10 1\n89 31 1\n57 17 2\n98 79 5\n46 41 3\nFbpbc\n28 21 0\n93 66 5\n66 21 0\n68 58 0\n59 17 3\n57 23 1\n72 71 1\n55 51 2\n58 40 5\n70 67 2\nKeiotmh\n73 44 4\n98 14 0\n19 7 0\n55 10 5\n30 25 4\n66 48 2\n66 51 4\n82 79 3\n73 63 4\n87 46 5\nNksd... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a Young diagram. \n\nGiven diagram is a histogram with n columns of lengths a_1, a_2, β¦, a_n (a... | [{"input": "100\n1980 1932 1906 1898 1892 1883 1877 1858 1842 1833 1777 1710 1689 1678 1660 1653 1648 1647 1644 1639 1635 1635 1593 1571 1534 1470 1440 1435 1389 1272 1269 1268 1263 1255 1249 1237 1174 1174 1128 1069 1067 981 979 979 951 915 911 906 863 826 810 810 802 785 764 752 743 710 705 696 676 661 639 619 616 57... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n~~~if-not:ruby,python\nReturn `1` when *any* odd bit of `x` equals 1; `0` otherwise.\n~~~\n~~~if:ruby,python\... | [{"input": "2863311530", "output": "[true]", "fn_name": "any_odd"}, {"input": "24082", "output": "[true]", "fn_name": "any_odd"}, {"input": "1024", "output": "[false]", "fn_name": "any_odd"}, {"input": "1365", "output": "[false]", "fn_name": "any_odd"}, {"input": "128", "output": "[true]", "fn_name": "any_odd"}, {"inpu... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYoung Timofey has a birthday today! He got kit of n cubes as a birthday present from his parents. Every cube ... | [{"input": "42\n-557774624 828320986 -345782722 -62979938 -681259411 -945983652 -139095040 832293378 -82572118 432027535 88438103 568183540 961782904 73543295 615958219 -5050584 322982437 -146046730 759453379 129267920 -819827396 -348156048 805080102 390723009 -771277251 -79011872 -592313207 528489973 656201270 -127795... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDefine a function that takes one integer argument and returns logical value `true` or `false` depending on if... | [{"input": "75", "output": "[false]", "fn_name": "is_prime"}, {"input": "-1", "output": "[false]", "fn_name": "is_prime"}, {"input": "0", "output": "[false]", "fn_name": "is_prime"}, {"input": "1", "output": "[false]", "fn_name": "is_prime"}, {"input": "73", "output": "[true]", "fn_name": "is_prime"}, {"input": "2", "o... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an undirected tree consisting of $n$ vertices. An undirected tree is a connected undirected gra... | [{"input": "7\n1 2\n2 3\n2 4\n4 5\n4 6\n5 7\n", "output": "2\n"}, {"input": "7\n1 2\n1 3\n2 4\n2 5\n3 6\n1 7\n", "output": "0\n"}, {"input": "7\n1 2\n2 3\n3 4\n3 5\n3 6\n3 7\n", "output": "1\n"}, {"input": "7\n1 2\n2 3\n2 4\n2 5\n3 6\n1 7\n", "output": "1\n"}, {"input": "7\n1 2\n2 3\n2 4\n2 5\n2 6\n1 7\n", "output": "0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEmacs is a text editor which is widely used by many programmers.\n\nThe advantage of Emacs is that we can mov... | [{"input": "hyo\nnh\nEND_OF_TEXT\ne\nd\nf\nf\nk\np\np\ne\ny\na\nk\ny\ny\nn\ny\n-", "output": "hyonhhyonhhyonh\n"}, {"input": "hyn\nnh\nEND_OF_TEXT\ne\nd\nf\nf\nk\np\np\ne\nx\na\nk\ny\ny\nn\ny\n-", "output": "hynnhhynnhhynnh\n"}, {"input": "oyh\nni\nEND_OF_TEXT\nf\nd\nf\nf\nk\np\np\ne\ny\na\nk\ny\ny\nn\ny\n-", "output":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSanta Claus likes palindromes very much. There was his birthday recently. k of his friends came to him to con... | [{"input": "10 20\njvyxocgomfmrtllgmagp 13\ngvtjnyaofrswcnnifzfq 17\nqisxpseggpjfoijmqnel -5\nlenqmjiofjpggespxsiq 14\nqfzfinncwsrfoaynjtvg 14\ncaayidazlylxyisihdhx 14\npgamglltrmfmogcoxyvj 11\nxhdhisiyxlylzadiyaac 2\ntbirihfpjgbbtclpxwhv 19\nvhwxplctbbgjpfhiribt 10\n", "output": "109\n"}, {"input": "10 20\njvyxocgomfm... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlice lives on a line. Today, she will travel to some place in a mysterious vehicle.\nInitially, the distance... | [{"input": "6 15\n4 3 5 4 0 1\n6\n1 2 1 4 4 6", "output": "YES\nYES\nYES\nYES\nYES\nYES\n"}, {"input": "6 15\n4 3 5 4 0 1\n6\n1 2 3 4 5 6", "output": "YES\nYES\nYES\nYES\nNO\nYES\n"}, {"input": "6 15\n4 3 5 8 2 1\n6\n1 3 3 0 5 5", "output": "YES\nYES\nYES\nNO\nYES\nYES\n"}, {"input": "6 15\n4 3 5 4 0 1\n6\n1 2 0 4 4 6"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRead problems statements in Mandarin Chinese and Russian. \n\nSuraj, the Chief Prankster is back in action n... | [{"input": "3\n10\n2 1 4 16 2\n0\n12\n2 1 0 8 17\n0\n10\n2 2 2 3 3\n10 2 2 1 4 3 2 9 1 1", "output": "7\n18\n5\n"}, {"input": "3\n10\n2 1 4 16 2\n0\n10\n2 1 0 8 11\n0\n10\n2 2 2 3 4\n10 2 2 1 4 3 2 9 1 0", "output": "7\n12\n6\n"}, {"input": "3\n10\n2 1 1 8 0\n0\n10\n2 0 3 13 7\n0\n10\n2 1 4 3 15\n3 0 2 1 5 5 2 9 1 1", ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are n stone quarries in Petrograd.\n\nEach quarry owns mi dumpers (1 β€ i β€ n). It is known that the fir... | [{"input": "30\n53 12\n13 98\n21 60\n76 58\n39 5\n62 58\n73 80\n13 75\n37 45\n44 86\n1 85\n13 33\n17 50\n12 26\n97 48\n52 40\n2 71\n95 79\n38 76\n24 54\n91 39\n97 92\n94 80\n50 61\n33 56\n22 91\n39 94\n31 56\n28 16\n20 44\n", "output": "tolik\n"}, {"input": "30\n53 12\n13 98\n21 60\n76 58\n39 5\n62 58\n73 80\n13 75\n37... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array of integers $a$ of length $n$. The elements of the array can be either different or th... | [{"input": "8\n4\n1 2 5 2\nBRBR\n2\n1 2\nBB\n5\n3 1 4 2 5\nBRRBR\n5\n4 1 3 1 4\nRBRRB\n5\n5 1 5 1 10\nRBRRA\n4\n2 2 2 2\nBRBR\n2\n1 -3\nBR\n4\n-2 -1 4 0\nRRRR\n", "output": "YES\nYES\nYES\nYES\nNO\nYES\nYES\nYES\n"}, {"input": "8\n4\n1 2 5 2\nBRBR\n2\n1 2\nBB\n5\n3 1 4 2 5\nBRRBR\n5\n4 1 5 1 4\nRBRRB\n5\n5 1 5 1 10\nRB... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nD: Arrow / Arrow\n\nproblem\n\nrodea is in a one-dimensional coordinate system and stands at x = 0. From this... | [{"input": "11 1\n11\n1\n16", "output": "1\n"}, {"input": "11 1\n11\n1\n6", "output": "-1\n"}, {"input": "15 1\n3\n1\n2", "output": "13\n"}, {"input": "15 1\n6\n1\n5", "output": "10\n"}, {"input": "15 1\n3\n1\n3", "output": "12\n"}, {"input": "15 1\n1\n1\n0", "output": "15\n"}, {"input": "15 1\n1\n1\n1", "output": "14\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a set of $N$ axis-aligned rectangles in the plane, find the area of regions which are covered by at lea... | [{"input": "4\n0 0 3 1\n-1 0 1 3\n-1 2 4 3\n3 0 3 3", "output": "11\n"}, {"input": "4\n0 0 3 1\n-1 0 1 3\n-1 0 4 3\n2 0 3 2", "output": "15\n"}, {"input": "4\n0 0 3 2\n-1 0 1 3\n-1 0 8 3\n2 0 3 2", "output": "27\n"}, {"input": "4\n0 -1 3 2\n0 2 1 5\n-1 0 0 5\n2 0 3 0", "output": "17\n"}, {"input": "4\n0 0 3 1\n0 0 0 3\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are three cells on an infinite 2-dimensional grid, labeled $A$, $B$, and $F$. Find the length of the sh... | [{"input": "7\n\n2 2\n0 3\n-1 2\n\n2 5\n2 2\n0 3\n\n1000 144\n1000 2\n1000 0000\n\n0 2\n3 10\n2 10\n\n0 13\n12 8\n2 10\n\n0 1\n4 1\n1 2\n\n2 413\n0 10\n1 0\n", "output": "3\n3\n142\n11\n17\n4\n405\n"}, {"input": "7\n\n2 2\n1 3\n-1 2\n\n2 5\n2 1\n2 3\n\n1000 144\n1000 1\n1000 0000\n\n0 2\n3 10\n2 10\n\n0 13\n12 8\n2 7\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAfter a team finished their training session on Euro football championship, Valeric was commissioned to gathe... | [{"input": "10894 92356\n", "output": "46178\n46179\n46177\n46180\n46176\n46181\n46175\n46182\n46174\n46183\n46173\n46184\n46172\n46185\n46171\n46186\n46170\n46187\n46169\n46188\n46168\n46189\n46167\n46190\n46166\n46191\n46165\n46192\n46164\n46193\n46163\n46194\n46162\n46195\n46161\n46196\n46160\n46197\n46159\n46198\n4... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a rooted tree with vertices numerated from $1$ to $n$. A tree is a connected graph without cycl... | [{"input": "8\n2 1\n-1 0\n1 1\n1 1\n1 1\n4 0\n5 1\n7 1\n", "output": "1 3 5 7 8\n"}, {"input": "8\n2 1\n-1 0\n1 1\n1 1\n1 1\n4 0\n5 1\n7 0\n", "output": "1 3 5\n"}, {"input": "8\n2 1\n-1 0\n1 0\n1 1\n2 1\n4 0\n5 1\n7 1\n", "output": "5 7 8\n"}, {"input": "8\n2 0\n-1 0\n1 1\n1 1\n1 1\n4 0\n2 1\n7 0\n", "output": "3 5\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He... | [{"input": "5\n3 24 14 10 13", "output": "1\n"}, {"input": "5\n3 24 16 10 13", "output": "1\n"}, {"input": "5\n3 36 16 10 13", "output": "1\n"}, {"input": "5\n3 36 16 14 13", "output": "1\n"}, {"input": "5\n3 34 14 10 13", "output": "1\n"}, {"input": "5\n3 24 16 16 13", "output": "2\n"}, {"input": "5\n3 36 18 14 13", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis is the easy version of the problem. The only difference is the constraints on $n$ and $k$. You can make ... | [{"input": "8 20\nccaccaca\n", "output": "ccaccacaccaccacaccac\n"}, {"input": "8 16\ndbcadabc\n", "output": "dbcadabcdbcadabc\n"}, {"input": "5 10\ndcdcd\n", "output": "dcdcdcdcdc\n"}, {"input": "5 10\ncbcbc\n", "output": "cbcbcbcbcb\n"}, {"input": "4 11\nddcd\n", "output": "ddcddcddcdd\n"}, {"input": "4 11\nzzaz\n", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nToday Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially ... | [{"input": "10\n+ 870566619432760298\n+ 869797178280285214\n+ 609920823721618090\n+ 221159591436767023\n+ 730599542279836538\n? 101001100111001011\n? 001111010101010011\n? 100010100011101110\n? 100110010110001100\n? 110000011101110011\n", "output": "0\n0\n0\n0\n0\n"}, {"input": "10\n+ 870566619432760298\n+ 869797178280... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe objective is to disambiguate two given names: the original with another\n\nThis kata is slightly more evo... | [{"input": "\"Carlos Ray Norris\"\n\"Carlos. Ray; Norris,\"", "output": "[true]", "fn_name": "could_be"}, {"input": "\"Carlos-Ray Norris\"\n\"Carlos-Ray Norris:\"", "output": "[true]", "fn_name": "could_be"}, {"input": "\"Carlos Ray-Norris\"\n\"Carlos? Ray-Norris\"", "output": "[true]", "fn_name": "could_be"}, {"input"... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\nC... | [{"input": "75634 912\n18125 601244640\n58230 951349939\n4017 753730550\n23636 124912128\n45120 23758881\n51811 316477853\n19326 139861106\n48018 406348942\n68864 391719264\n1850 712458521\n2796 385027567\n12731 564315721\n43367 828330253\n30104 102450015\n64351 340641907\n19781 414658282\n53502 122572188\n11063 262174... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nProf. Hachioji has devised a new numeral system of integral numbers with four lowercase letters \"m\", \"c\",... | [{"input": "10\nxi x8i\ni 9i\nc2x2i 5c9x8i\nm2ci 4m7c9x8i\n8c9x8i i\ni 9m9c9x8i\nm i\ni m\nm9i i\n8m9c7xi c1x8i", "output": "2x9i\nx\n7c2x\n5m9c9x9i\n8c9x9i\n9m9c9x9i\nmi\nmi\nmx\n9m8x9i\n"}, {"input": "10\nxi x8i\ni 9i\nc2x3i 5c8x8i\nm2ci 4m7c9x8i\n9c8x9i i\ni 9m9c9x8i\nm i\ni m\nm9i i\n9m8c7xi c2x8i", "output": "2x9i... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nProblem statement\n\nThere are rectangles with vertical and horizontal lengths of h and w, and square squares... | [{"input": "3\n1 11\n5 11\n4 5", "output": "6 5\n28 27\n1 1\n"}, {"input": "3\n1 11\n5 11\n3 5", "output": "6 5\n28 27\n8 7\n"}, {"input": "3\n2 11\n5 11\n3 5", "output": "1 1\n28 27\n8 7\n"}, {"input": "3\n3 12\n13 7\n1 4", "output": "1 1\n46 45\n1 1\n"}, {"input": "3\n1 8\n3 11\n4 3", "output": "1 1\n17 16\n1 1\n"}, ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet's solve the geometric problem\n\nMr. A is still solving geometric problems today. It is important to be a... | [{"input": "128 205", "output": "205\n"}, {"input": "110 161", "output": "161\n"}, {"input": "13 204", "output": "102\n"}, {"input": "11 251", "output": "251\n"}, {"input": "10 103", "output": "103\n"}, {"input": "23 217", "output": "217\n"}, {"input": "23 193", "output": "193\n"}, {"input": "21 440", "output": "110\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have a long fence which consists of $n$ sections. Unfortunately, it is not painted, so you decided to hir... | [{"input": "48 47\n34 44\n24 45\n21 36\n29 38\n17 29\n20 29\n30 32\n23 40\n47 48\n36 43\n2 37\n27 42\n11 17\n26 47\n4 16\n24 35\n32 47\n8 22\n28 46\n17 26\n36 43\n1 26\n26 40\n26 47\n5 38\n20 33\n6 27\n9 33\n2 7\n17 35\n12 18\n20 36\n20 43\n22 45\n13 44\n3 7\n1 33\n7 45\n20 36\n33 41\n10 11\n29 35\n17 21\n10 24\n39 41\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \nAfter a long time, Chef has f... | [{"input": "3\n3\nRGR\n3\nRRR\n3\nGRB", "output": "1\n0\n2\n"}, {"input": "3\n3\nGRR\n3\nRRR\n3\nGRB", "output": "1\n0\n2\n"}, {"input": "3\n3\nRGR\n3\nRRR\n3\nRBG", "output": "1\n0\n2\n"}, {"input": "3\n3\nGRR\n3\nRRR\n3\nBRG", "output": "1\n0\n2\n"}, {"input": "3\n3\nRRG\n3\nRRR\n3\nRGB", "output": "1\n0\n2\n"}, {"in... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are league games and tournament games in sports competitions. In soccer league games, points are given ... | [{"input": "4\nJapan 1 0 2\nEgypt 1 3 -1\nCanada 0 2 1\nSpain 1 0 1\n3\nJndia -1 2 0\nPoland 1 1 1\nItalx 1 -1 1\n0", "output": "Japan,5\nSpain,4\nEgypt,2\nCanada,1\n\nPoland,4\nItalx,4\nJndia,-3\n"}, {"input": "4\nnapaJ 1 0 0\nEgzpt 0 2 -1\naDaadn 0 2 3\nnibpS 2 0 0\n3\nioIda 0 0 -6\nPoland 1 0 3\nItaly 2 0 1\n0", "ou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nproblem\n\nAOR Ika and you came to the tournament-style table tennis tournament singles section for reconnais... | [{"input": "66 -51", "output": "116\n"}, {"input": "66 -87", "output": "152\n"}, {"input": "66 -49", "output": "114\n"}, {"input": "96 -49", "output": "144\n"}, {"input": "96 -45", "output": "140\n"}, {"input": "96 -10", "output": "105\n"}, {"input": "96 -13", "output": "108\n"}, {"input": "96 -11", "output": "106\n"},... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRyouko is an extremely forgetful girl, she could even forget something that has just happened. So in order to... | [{"input": "100 100\n28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\nWe want to deploy som... | [{"input": "14 3\n", "output": "2\n"}, {"input": "20 4\n", "output": "3\n"}, {"input": "15 2\n", "output": "3\n"}, {"input": "20 2\n", "output": "4\n"}, {"input": "17 8\n", "output": "1\n"}, {"input": "15 3\n", "output": "3\n"}, {"input": "17 4\n", "output": "2\n"}, {"input": "20 1\n", "output": "7\n"}, {"input": "1 20... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Romans have attacked again. This time they are much more than the Persians but Shapur is ready to defeat ... | [{"input": "97\n800 771 66 126 231 306 981 96 196 229 253 35 903 739 461 962 979 347 152 424 934 586 225 838 103 178 524 400 156 149 560 629 697 417 717 738 181 430 611 513 754 595 847 464 356 640 24 854 138 481 98 371 142 460 194 288 220 41 999 581 441 407 301 651 271 226 457 393 980 166 272 250 900 337 358 359 80 904... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis is a very simply formulated task. Let's call an integer number `N` 'green' if `NΒ²` ends with all of the ... | [{"input": "110", "output": "[9580863811000557423423230896109004106619977392256259918212890625]", "fn_name": "green"}, {"input": "100", "output": "[6188999442576576769103890995893380022607743740081787109376]", "fn_name": "green"}, {"input": "12", "output": "[2890625]", "fn_name": "green"}, {"input": "13", "output": "[7... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are n students who have taken part in an olympiad. Now it's time to award the students.\n\nSome of them... | [{"input": "2106623580587 109123020071\n", "output": "9 982107180639 1124516399939 "}, {"input": "1000000000000 499999999999\n", "output": "1 499999999999 500000000000\n"}, {"input": "1000000000000 1000\n", "output": "499500499 499500499000 500000000501\n"}, {"input": "1000000000000 32416187567\n", "output": "15 486242... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a program which reads a list of student test scores and evaluates the performance for each student.\n\n... | [{"input": "92 101 -1\n16 30 -1\n0 2 -1\n-1 -1 -1", "output": "A\nD\nF\n"}, {"input": "150 64 -2\n16 30 -1\n1 0 -1\n-1 -1 -1", "output": "A\nD\nF\n"}, {"input": "116 100 -1\n16 50 -1\n1 1 0\n-1 -1 -1", "output": "A\nB\nF\n"}, {"input": "92 111 -1\n16 30 -1\n0 2 -1\n-1 -1 -1", "output": "A\nD\nF\n"}, {"input": "150 64 -... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe description is rather long but it tries to explain what a financing plan is. \n\nThe fixed monthly paymen... | [{"input": "9.0\n187174\n60\n12", "output": "[\"num_payment 12 c 3885 princ 2694 int 1191 balance 156135\"]", "fn_name": "amort"}, {"input": "1.9\n182840\n48\n18", "output": "[\"num_payment 18 c 3959 princ 3769 int 189 balance 115897\"]", "fn_name": "amort"}, {"input": "7.0\n168742\n48\n16", "output": "[\"num_payment 1... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolandBall has such a convex polygon with n veritces that no three of its diagonals intersect at the same poi... | [{"input": "2633 717\n", "output": "2 3 4 6 9 12 15 19 24 29 34 40 47 54 62 71 80 89 99 110 121 132 144 157 170 184 199 214 229 245 262 279 296 314 333 352 372 393 414 435 457 480 503 526 550 575 600 626 653 680 707 735 764 793 822 852 883 914 946 979 1012 1045 1079 1114 1149 1184 1220 1257 1294 1332 1371 1410 1449 148... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nChef loves games! But he likes to invent his own. Now he plays game \"Digit Jump\". Chef has a sequence of di... | [{"input": "012134444444443", "output": "4\n"}, {"input": "20776892991725", "output": "2\n"}, {"input": "10353326888495", "output": "4\n"}, {"input": "14708953637626", "output": "5\n"}, {"input": "6858574858270", "output": "5\n"}, {"input": "2595212919780", "output": "6\n"}, {"input": "1149262658611", "output": "1\n"},... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n - For eac... | [{"input": "34\n84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822 84822\n", "output": "17\n"}, {"input": "6\n105 119 105 119 105 119\n", "output": "0\n"}, {"input": "4\n3 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp has n different binary words. A word called binary if it contains only characters '0' and '1'. For e... | [{"input": "4\n4\n0001\n1000\n0011\n0111\n3\n010\n111\n0\n2\n00000\n00001\n4\n01\n001\n0001\n00001\n", "output": "1\n3\n-1\n0\n\n2\n1 2\n"}, {"input": "4\n4\n0001\n0000\n0011\n0111\n3\n010\n111\n1\n2\n00000\n00001\n4\n01\n001\n0001\n00001\n", "output": "1\n1\n-1\n0\n\n2\n1 2\n"}, {"input": "4\n4\n0001\n0000\n0011\n0111... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n## Number pyramid\n\nNumber pyramid is a recursive structure where each next row is constructed by adding adj... | [{"input": "[13, 76, 21, 42, 63]", "output": "[674]", "fn_name": "reduce_pyramid"}, {"input": "[13, 1, 21, 9]", "output": "[88]", "fn_name": "reduce_pyramid"}, {"input": "[5, 6, 7, 8]", "output": "[52]", "fn_name": "reduce_pyramid"}, {"input": "[3, 9, 4]", "output": "[25]", "fn_name": "reduce_pyramid"}, {"input": "[3, ... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNam is playing with a string on his computer. The string consists of n lowercase English letters. It is meani... | [{"input": "198 10\ntuxqalctjyegbvouezfiqoeoazizhmjhpcmvyvjkyrgxkeupwcmvzcosdrrfgtdmxwfttxjxsbaspjwftgpnvsfyfqsrmyjmypdwonbzwsftepwtjlgbilhcsqyfzfzrfvrvfqiwoemthwvqpvqnflqqspvqrnmvucnspexpijnivqpavqxjyucufculletaedlvut\n", "output": "695\n"}, {"input": "198 14\ntuxqalctjyegbvouezfiqoeoazizhmjhpcmvyvjkyrgxkeupwcmvzcosdr... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are both a shop keeper and a shop assistant at a small nearby shop. You have $n$ goods, the $i$-th good c... | [{"input": "3\n5\n1 2 6 4 5\n3\n1 2 3\n2\n777 2131\n", "output": "4\n2\n1454\n"}, {"input": "3\n5\n1 2 3 4 5\n3\n1 2 3\n2\n777 1089\n", "output": "3\n2\n933\n"}, {"input": "3\n5\n1 2 6 4 5\n3\n1 2 3\n2\n777 1089\n", "output": "4\n2\n933\n"}, {"input": "3\n5\n0 3 3 16 5\n3\n2 2 3\n2\n777 778\n", "output": "6\n3\n778\n"}... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne day, Snuke was given a permutation of length N, a_1, a_2, ..., a_N, from his friend.\n\nFind the followin... | [{"input": "8\n5 3 8 1 2 6 7 4", "output": "84\n"}, {"input": "8\n4 5 8 1 2 6 7 3", "output": "86\n"}, {"input": "8\n5 4 8 1 2 6 7 3", "output": "85"}, {"input": "4\n2 3 1 4", "output": "17\n"}, {"input": "4\n1 3 4 2", "output": "20\n"}, {"input": "4\n3 2 4 1", "output": "19\n"}, {"input": "4\n2 3 4 1", "output": "20\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-G... | [{"input": "100\n", "output": "543\n"}, {"input": "52\n", "output": "123\n"}, {"input": "54\n", "output": "131\n"}, {"input": "77\n", "output": "323\n"}, {"input": "78\n", "output": "324\n"}, {"input": "90\n", "output": "384\n"}, {"input": "91\n", "output": "391\n"}, {"input": "92\n", "output": "491\n"}, {"input": "94\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA team of students from the city S is sent to the All-Berland Olympiad in Informatics. Traditionally, they go... | [{"input": "200\n2 1 1 2 2 2 2 1 1 2 2 2 1 1 2 2 2 2 1 1 1 2 2 2 2 2 2 1 2 2 1 1 1 1 2 1 2 2 1 2 2 2 2 1 2 2 1 1 1 1 2 2 1 1 1 1 1 2 2 2 2 1 2 1 2 2 2 2 1 1 1 2 1 2 2 2 2 1 1 1 1 1 1 2 2 2 1 2 2 2 1 2 2 2 1 1 1 2 2 1 1 1 1 2 2 1 2 1 1 1 2 2 1 1 2 2 2 1 2 2 0 1 2 1 1 2 2 2 1 2 2 1 1 1 2 2 2 1 2 1 2 1 2 1 1 2 2 1 1 1 1 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two lists of non-zero digits.\n\nLet's call an integer pretty if its (base 10) representation h... | [{"input": "9 9\n5 4 3 2 1 6 7 8 9\n3 2 1 5 4 7 8 9 6\n", "output": "1\n"}, {"input": "9 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n", "output": "1\n"}, {"input": "9 9\n1 2 3 4 5 6 7 8 9\n9 8 7 6 5 4 3 2 1\n", "output": "1\n"}, {"input": "9 9\n9 8 7 6 5 4 3 2 1\n1 2 3 4 5 6 7 8 9\n", "output": "1\n"}, {"input": "9 9\n9 8... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp is a frequent user of the very popular messenger. He's chatting with his friends all the time. He ha... | [{"input": "100 100\n82 51 81 14 37 17 78 92 64 15 8 86 89 8 87 77 66 10 15 12 100 25 92 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 1 76 80 60 100 49 70 59 72 8 38 71 15 97 71 14 76 90 81 4 59 46 39 28 92 3 28 22 53 99 59 52 74 43 92 43 42 23 44 9 82 47 7 48 12 12 3 55 37 71 46 22 84 52 98 41 21 77 63 17 62 91\n", "o... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSnuke has a blackboard and a set S consisting of N integers. The i-th element in S is S_i.\n\nHe wrote an int... | [{"input": "10 100000\n13715 50001 13306 50003 50004 59986 50006 110740 62164 36071", "output": "491699060\n"}, {"input": "10 100000\n13715 50001 13306 50003 50004 59986 50006 110740 62439 36071", "output": "380819060\n"}, {"input": "10 100000\n13715 50001 13306 50003 50004 59986 50006 110740 49261 36071", "output": "6... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAn architect, Devunky, who lives in Water Deven, has been asked to renovate an old large hospital.\n\nIn some... | [{"input": "15\n100\n1000000000\n1\n0", "output": "19\n155\n9358757000\n1\n"}, {"input": "15\n110\n1000000000\n1\n0", "output": "19\n178\n9358757000\n1\n"}, {"input": "15\n101\n1000000000\n3\n0", "output": "19\n157\n9358757000\n3\n"}, {"input": "15\n101\n1001000000\n3\n0", "output": "19\n157\n9372508100\n3\n"}, {"input... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJzzhu has a big rectangular chocolate bar that consists of n Γ m unit squares. He wants to cut this bar exact... | [{"input": "1000000000 1000000000 999999999\n", "output": "1000000000\n"}, {"input": "1000000000 1000000000 220000000\n", "output": "4000000000\n"}, {"input": "1000000000 1000000000 123456\n", "output": "8099000000000\n"}, {"input": "1000000000 1000000000 1\n", "output": "500000000000000000\n"}, {"input": "1000000000 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDark is going to attend Motarack's birthday. Dark decided that the gift he is going to give to Motarack is an... | [{"input": "7\n5\n-1 3 -1 24 -1\n5\n-1 40 14 -1 35\n6\n-1 -1 6 -1 0 -1\n2\n-1 -1\n2\n0 -1\n4\n1 -1 3 -1\n7\n1 -1 7 10 0 0 10\n", "output": "11 13\n26 27\n3 3\n0 0\n0 0\n1 2\n10 4\n"}, {"input": "7\n5\n-1 10 -1 20 -1\n5\n-1 22 35 -1 35\n6\n-1 -1 9 -1 3 -1\n2\n-1 -1\n2\n0 -1\n4\n1 -1 3 -1\n7\n0 -1 12 5 2 -1 0\n", "output... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nChef has a binary tree. The binary tree consists of 1 or more nodes. Each node has a unique integer id. Each ... | [{"input": "2\n1\n10 0\n6\n1 5\n2 0\n3 0\n4 0\n5 5\n10 5", "output": "10\n10\n"}, {"input": "2\n1\n4 0\n6\n1 11\n2 0\n4 0\n8 -1\n5 5\n-1 5", "output": "4\n-1\n"}, {"input": "2\n1\n4 0\n6\n1 11\n2 0\n4 0\n8 -1\n5 5\n-2 5", "output": "4\n-2\n"}, {"input": "2\n1\n16 0\n6\n-1 8\n1 1\n3 0\n7 0\n0 3\n6 5", "output": "16\n-1\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAtCoDeer the deer is going on a trip in a two-dimensional plane.\nIn his plan, he will depart from point (0, ... | [{"input": "2\n-3 4 1\n111 4 -1", "output": "No\n"}, {"input": "2\n5 1 1\n100 1 1\n", "output": "No\n"}, {"input": "2\n5 2 3\n100 0 0", "output": "Yes\n"}, {"input": "2\n5 2 2\n100 1 -1", "output": "No\n"}, {"input": "2\n5 2 1\n111 1 0", "output": "Yes\n"}, {"input": "2\n2 1 1\n100 1 1", "output": "Yes\n"}, {"input": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEach of you probably has your personal experience of riding public transportation and buying tickets. After a... | [{"input": "100\n11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222\n", "output": "YES\n"}, {"input": "100\n77183123282838517843664381789267288922656323541699343586762218... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMr. Chanek is currently participating in a science fair that is popular in town. He finds an exciting puzzle ... | [{"input": "6 1\n1 10 10 5 20 100\n1000000 1 10 10 100 1000000\n", "output": "144\n"}, {"input": "6 1\n1 10 10 20 5 100\n1000000 1 10 100 10 1000000\n", "output": "144\n"}, {"input": "6 1\n1 10 10 5 20 100\n1000000 1 10 10 100 1000000\n", "output": "144\n"}, {"input": "6 1\n1 10 10 20 5 100\n1000000 1 10 100 10 1000000... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.