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\nProblem\n\nFind the angle between the two given angles θ1 and θ2. Here, the angle between them is defined as \"θ1 & plus; t'when t'is the one with the smallest absolute value among the t satisfying θ1 & plus; t = θ2 − t\"... | [{"type": "stdin_stdout", "input": "20\n594", "output": "127.0000000000\n"}, {"type": "stdin_stdout", "input": "20\n704", "output": "182.0000000000\n"}, {"type": "stdin_stdout", "input": "20\n682", "output": "171.0000000000\n"}, {"type": "stdin_stdout", "input": "20\n253", "output": "316.5000000000\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour task is to calculate the distance between two $n$ dimensional vectors $x = \\\\{x_1, x_2, ..., x_n\\\\}$ and $y = \\\\{y_1, y_2, ..., y_n\\\\}$.\n\nThe Minkowski's distance defined below is a metric which is a genera... | [{"type": "stdin_stdout", "input": "3\n109 25 10\n-1 -3 -3", "output": "151.000000\n114.249726\n110.661278\n110.000000\n"}, {"type": "stdin_stdout", "input": "3\n109 25 10\n0 -3 -3", "output": "150.000000\n113.287246\n109.673356\n109.000000\n"}, {"type": "stdin_stdout", "input": "3\n109 25 10\n-1 -3 0", "output": "148.... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe electrical resistance is the opposition to the passage of electric current. If two resistors with resistance R1 and R2 are connected to each other, the resultant resistance R depends on how their ends are connected. I... | [{"type": "stdin_stdout", "input": "3\n1 36\n2 16\n100 11111", "output": "1/1\n2/3\n10456/4100\n"}, {"type": "stdin_stdout", "input": "3\n1 20\n4 17\n100 10010", "output": "1/1\n13/4\n5501/5775\n"}, {"type": "stdin_stdout", "input": "3\n1 20\n4 17\n101 10010", "output": "1/1\n13/4\n1266/7041\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Chef's house there are N apples lying in a row on the floor. These apples are numbered from 1 (left most one) to N (right most one). The types of apples are also numbered by positive integers, and the type of apple i i... | [{"type": "stdin_stdout", "input": "5 12\n1 4 4 2 -1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 24\n1 4 4 2 -1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 24\n1 7 4 2 -1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 24\n1 6 4 2 -1", "output": "-1\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter the war, the supersonic rocket became the most common public transportation.\n\nEach supersonic rocket consists of two \"engines\". Each engine is a set of \"power sources\". The first engine has n power sources, an... | [{"type": "stdin_stdout", "input": "8 8\n53212775 61830464\n32047271 31958754\n46845363 47341547\n46097536 79640734\n25559819 90360169\n5442822 40309249\n57656501 31139219\n1191345 7784770\n61052639 71686018\n53542361 10165576\n61963163 25946318\n15498921 83261369\n97981085 40697107\n35269685 20583089\n50275077 3751318... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMonocarp has decided to buy a new TV set and hang it on the wall in his flat. The wall has enough free space so Monocarp can buy a TV set with screen width not greater than a and screen height not greater than b. Monocarp... | [{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000\n", "output": "1000000000000000000\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 999999866000004473 999999822000007597\n", "output": "1000000063\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMasha has three sticks of length a, b and c centimeters respectively. In one minute Masha can pick one arbitrary stick and increase its length by one centimeter. She is not allowed to break sticks.\n\nWhat is the minimum ... | [{"type": "stdin_stdout", "input": "100 100 100\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "100 10 10\n", "output": "81\n"}, {"type": "stdin_stdout", "input": "100 100 99\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "14 21 76\n", "output": "42\n"}, {"type": "stdin_stdout", "input": "32 99 10\n",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKilani is playing a game with his friends. This game can be represented as a grid of size n × m, where each cell is either empty or blocked, and every player has one or more castles in some cells (there are no two castles... | [{"type": "stdin_stdout", "input": "4 7 2\n13 1\n###....\n..1..#.\n.###.#.\n.....#2\n", "output": "18 1 \n"}, {"type": "stdin_stdout", "input": "4 7 2\n13 1\n....###\n.#..1..\n.#.###.\n2#.....\n", "output": "18 1 \n"}, {"type": "stdin_stdout", "input": "4 7 2\n13 1\n###....\n.#..1..\n.###.#.\n.....#2\n", "output": "18 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nServal soon said goodbye to Japari kindergarten, and began his life in Japari Primary School.\n\nIn his favorite math class, the teacher taught him the following interesting definitions.\n\nA parenthesis sequence is a str... | [{"type": "stdin_stdout", "input": "300\n?(??(??????????(?????????(????(????)???????????((??????((??(???(?(((????(??((?((((??(?(?????(???????????)??)????????(?(????????(?(??(???????(???(???((???()?????(???????(?????(?????((?????????(??(????(????????((?????????((???????)?()????????(??????)???????????(??(??????(?(???????... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a function f written in some basic language. The function accepts an integer value, which is immediately written into some variable x. x is an integer variable and can be assigned values from 0 to 2^{32}-1. ... | [{"type": "stdin_stdout", "input": "83\nadd\nfor 58\nend\nadd\nadd\nfor 36\nfor 84\nadd\nadd\nfor 86\nadd\nadd\nend\nend\nadd\nadd\nadd\nadd\nfor 23\nadd\nadd\nadd\nfor 70\nadd\nadd\nend\nfor 24\nfor 58\nend\nadd\nend\nend\nend\nfor 41\nfor 51\nend\nfor 22\nfor 39\nend\nfor 94\nfor 47\nadd\nfor 57\nend\nadd\nend\nfor 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have a list of numbers from 1 to n written from left to right on the blackboard.\n\nYou perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering on... | [{"type": "stdin_stdout", "input": "2\n1000000000 1\n1000000000 500000000\n", "output": "2\n1000000000\n"}, {"type": "stdin_stdout", "input": "3\n3 1\n4 2\n69 6\n", "output": "2\n4\n12\n"}, {"type": "stdin_stdout", "input": "3\n3 1\n5 2\n69 6\n", "output": "2\n4\n12\n"}, {"type": "stdin_stdout", "input": "3\n3 1\n5 2\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two bracket sequences (not necessarily regular) s and t consisting only of characters '(' and ')'. You want to construct the shortest regular bracket sequence that contains both given bracket sequences as su... | [{"type": "stdin_stdout", "input": "((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((\n))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array a consisting of n integers.\n\nIn one move, you can choose two indices 1 ≤ i, j ≤ n such that i ≠ j and set a_i := a_j. You can perform such moves any number of times (possibly, zero). You can choos... | [{"type": "stdin_stdout", "input": "5\n2\n0 3\n4\n2 0 13 1\n3\n3 3 3\n4\n5 10 5 4\n4\n2 1 1 2\n", "output": "YES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n2\n0 3\n4\n2 0 25 1\n3\n3 3 3\n4\n5 10 5 4\n4\n2 1 1 2\n", "output": "YES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n2\n0 3\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nwHAT DO WE NEED cAPS LOCK FOR?\n\nCaps lock is a computer keyboard key. Pressing it sets an input mode in which typed letters are capital by default. If it is pressed by accident, it leads to accidents like the one we had... | [{"type": "stdin_stdout", "input": "cTKDZNWVYRTFPQLDAUUNSPKTDJTUPPFPRXRSINTVFVNNQNKXWUZUDHZBUSOKTABUEDQKUIVRTTVUREEOBJTSDKJKVEGFXVHXEYPE\n", "output": "Ctkdznwvyrtfpqldauunspktdjtuppfprxrsintvfvnnqnkxwuzudhzbusoktabuedqkuivrttvureeobjtsdkjkvegfxvhxeype\n"}, {"type": "stdin_stdout", "input": "KETAXTSWAAOBKUOKUQREHIOMVMM... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider the infinite sequence s of positive integers, created by repeating the following steps:\n\n 1. Find the lexicographically smallest triple of positive integers (a, b, c) such that \n * a ⊕ b ⊕ c = 0, where ⊕ d... | [{"type": "stdin_stdout", "input": "9\n2\n3\n3\n12\n13\n6\n7\n11\n9\n", "output": "2\n3\n3\n13\n7\n12\n5\n11\n15\n"}, {"type": "stdin_stdout", "input": "9\n2\n3\n3\n12\n10\n6\n3\n22\n6\n", "output": "2\n3\n3\n13\n6\n12\n3\n18\n12\n"}, {"type": "stdin_stdout", "input": "9\n1\n5\n3\n4\n18\n6\n12\n8\n9\n", "output": "1\n8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n athletes in front of you. Athletes are numbered from 1 to n from left to right. You know the strength of each athlete — the athlete number i has the strength s_i.\n\nYou want to split all athletes into two tea... | [{"type": "stdin_stdout", "input": "5\n5\n3 1 2 10 4\n6\n2 1 3 4 4 3\n4\n14 9 3 1\n2\n0 1000\n3\n110 150 200\n", "output": "1\n0\n2\n1000\n40\n"}, {"type": "stdin_stdout", "input": "5\n5\n3 1 2 10 4\n6\n2 1 3 4 4 3\n4\n14 9 3 1\n2\n0 1000\n3\n100 150 200\n", "output": "1\n0\n2\n1000\n50\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n programmers that you want to split into several non-empty teams. The skill of the i-th programmer is a_i. You want to assemble the maximum number of teams from them. There is a restriction for each team: the n... | [{"type": "stdin_stdout", "input": "3\n5 10\n13 11 2 14 1\n4 8\n2 4 2 1\n4 8\n1 3 3 7\n", "output": "3\n0\n1\n"}, {"type": "stdin_stdout", "input": "3\n5 10\n14 11 4 5 1\n4 11\n2 7 2 1\n4 8\n1 4 3 2\n", "output": "2\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n5 17\n7 11 2 9 5\n4 8\n2 1 2 3\n4 11\n1 3 3 11\n", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider the following process. You have a binary string (a string where each character is either 0 or 1) w of length n and an integer x. You build a new binary string s consisting of n characters. The i-th character of s... | [{"type": "stdin_stdout", "input": "3\n100110\n2\n01\n1\n111\n1\n", "output": "011001\n10\n111\n"}, {"type": "stdin_stdout", "input": "3\n100110\n2\n01\n1\n101\n1\n", "output": "011001\n10\n010\n"}, {"type": "stdin_stdout", "input": "3\n100110\n2\n01\n0\n101\n1\n", "output": "011001\n01\n010\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne drew a closed polyline on a plane, that consisted only of vertical and horizontal segments (parallel to the coordinate axes). The segments alternated between horizontal and vertical ones (a horizontal segment was alwa... | [{"type": "stdin_stdout", "input": "12\n4\n3 4 4 5\n4\n3 3 3 3\n\n4\n3 4 5 4\n4\n3 3 3 3\n\n4\n3 5 4 4\n4\n3 3 3 3\n\n4\n4 3 4 5\n4\n3 3 3 3\n\n4\n4 3 5 4\n4\n3 3 3 3\n\n4\n4 4 3 5\n4\n3 3 3 3\n\n4\n4 4 5 3\n4\n3 3 3 3\n\n4\n4 5 3 4\n4\n3 3 3 3\n\n4\n4 5 4 3\n4\n3 3 3 3\n\n4\n5 3 4 4\n4\n3 3 3 3\n\n4\n5 4 3 4\n4\n3 3 3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's call two strings a and b (both of length k) a bit similar if they have the same character in some position, i. e. there exists at least one i ∈ [1, k] such that a_i = b_i.\n\nYou are given a binary string s of lengt... | [{"type": "stdin_stdout", "input": "1\n360 180\n11111111111110100101001110011110110000111011001100100001101001100000010110010101101100110011111110101011001101001111011000000101100100100100000101110010110110001010011100100111010000101110010011100101000110110100111010000010010010011010000001101111001011001101010111111100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDiamond Miner is a game that is similar to Gold Miner, but there are n miners instead of 1 in this game.\n\nThe mining area can be described as a plane. The n miners can be regarded as n points on the y-axis. There are n ... | [{"type": "stdin_stdout", "input": "3\n2\n0 1\n1 0\n0 -1\n-2 0\n4\n1 0\n3 0\n-5 0\n6 0\n0 3\n0 1\n0 2\n0 4\n5\n3 0\n0 4\n0 -3\n4 0\n2 0\n1 0\n-3 0\n0 -10\n0 -2\n0 -10\n", "output": "\n3.650281539872885\n18.061819283610362\n32.052255376143336\n"}, {"type": "stdin_stdout", "input": "3\n2\n0 1\n1 0\n0 -1\n-2 0\n4\n1 0\n3 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nReforms have started in Berland again! At this time, the Parliament is discussing the reform of the calendar. To make the lives of citizens of Berland more varied, it was decided to change the calendar. As more and more p... | [{"type": "stdin_stdout", "input": "1000000 5000000\n", "output": "11514506860120\n"}, {"type": "stdin_stdout", "input": "4000000 5000000\n", "output": "21384022194564\n"}, {"type": "stdin_stdout", "input": "5000000 5000000\n", "output": "24674231279431\n"}, {"type": "stdin_stdout", "input": "3000000 5000000\n", "outpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou know that the Martians use a number system with base k. Digit b (0 ≤ b < k) is considered lucky, as the first contact between the Martians and the Earthlings occurred in year b (by Martian chronology).\n\nA digital ro... | [{"type": "stdin_stdout", "input": "11 1 199\n10 1 2 1 6 2 0 1 9 9 0 5 5 4 0 1 8 7 7 5 2 5 6 10 7 1 6 8 0 8 10 9 1 8 1 6 1 3 6 1 9 0 5 3 6 8 7 5 10 1 1 10 1 6 10 8 10 10 9 1 3 10 2 3 8 10 6 1 7 7 10 5 2 2 7 2 0 2 1 8 6 5 9 6 7 10 2 9 1 4 2 4 5 4 1 5 6 1 1 1 5 2 6 8 8 3 8 6 5 4 2 1 6 5 0 6 5 4 3 7 4 7 6 8 6 6 6 4 10 4 6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently Bob invented a new game with a tree (we should remind you, that a tree is a connected graph without cycles): he deletes any (possibly, zero) amount of edges of the tree, and counts the product of sizes of the con... | [{"type": "stdin_stdout", "input": "50\n45 39\n18 12\n13 6\n48 45\n46 36\n46 8\n40 36\n29 28\n2 18\n43 26\n25 14\n43 31\n13 30\n12 35\n38 42\n20 5\n7 35\n10 50\n27 13\n1 41\n24 21\n25 5\n7 31\n15 45\n32 25\n43 23\n4 50\n46 11\n40 14\n37 21\n50 2\n41 42\n43 30\n14 22\n36 48\n8 24\n49 20\n19 26\n32 10\n35 29\n1 6\n34 33\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle penguin Polo adores strings. But most of all he adores strings of length n.\n\nOne day he wanted to find a string that meets the following conditions:\n\n 1. The string consists of n lowercase English letters (tha... | [{"type": "stdin_stdout", "input": "70054 25\n", "output": "abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya plays the sleuth with his friends. The rules of the game are as follows: those who play for the first time, that is Vasya is the sleuth, he should investigate a \"crime\" and find out what is happening. He can ask a... | [{"type": "stdin_stdout", "input": "ARIWmwqFqxsQXsXXzHqvFjxOCttAGPUzDtWzsenPYdNXuFOIUGYZsLLK IaoxiyjBBRThoelwdPTkuCQfcBLUEJpCPIrVZlvUWA?\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "ARIWmwqFqxsQXsXXzHqvFjxOCttAGPUzDtWzsenPYdNXuFOIUGYZsLLK IaoxiykBBRThoelwdPTkuCQfcBLUEJpCPIrVZlvUWA?\n", "output": "YES\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA Martian boy is named s — he has got this name quite recently from his parents for his coming of age birthday. Now he enjoys looking for his name everywhere. If he sees that he can obtain his name from some string by rem... | [{"type": "stdin_stdout", "input": "mars\nsunvenusearthmarsjupitersaturnuranusneptune\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "mars\nsunvenusearthmarsjupitersatuqnuranusneptune\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "mars\nsunvenusearthmarsjupitersatuqnuranusnepttne\n", "output": "0\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven simple (without self-intersections) n-gon. It is not necessary convex. Also you are given m lines. For each line find the length of common part of the line and the n-gon.\n\nThe boundary of n-gon belongs to polygon.... | [{"type": "stdin_stdout", "input": "3 8\n-100000 -100000\n100000 100000\n1 0\n-100000 -100000 100000 -80000\n-100000 -100000 100000 -99000\n-100000 -100000 100000 -99990\n-100000 -100000 100000 -99999\n-100000 -100000 100000 -99999.99\n-100000 -100000 100000 100000\n-100000 -100000 100000 99999.99\n-100000 100000 10000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nValerian was captured by Shapur. The victory was such a great one that Shapur decided to carve a scene of Valerian's defeat on a mountain. So he had to find the best place to make his victory eternal!\n\nHe decided to vis... | [{"type": "stdin_stdout", "input": "15\n12 1 52\n6 2 10\n4 1 55\n11 7 20\n10 3 54\n13 9 44\n15 2 6\n14 5 55\n9 3 32\n2 1 32\n8 4 14\n6 5 24\n5 3 74\n7 6 157\n", "output": "1039\n"}, {"type": "stdin_stdout", "input": "15\n12 1 52\n3 2 10\n4 1 45\n11 7 20\n10 3 54\n13 9 44\n15 2 6\n14 5 55\n9 3 32\n2 1 32\n8 4 14\n6 5 24... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe \"Bulls and Cows\" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.\n\nThe thinker thinks of a four-digit number in the decimal system. All the digits in the number are ... | [{"type": "stdin_stdout", "input": "10\n0132 0 1\n6801 0 1\n8749 1 1\n8036 0 0\n7384 0 2\n8594 0 1\n9307 1 0\n7390 0 1\n6127 1 1\n0381 0 1\n", "output": "Incorrect data\n"}, {"type": "stdin_stdout", "input": "10\n8795 0 3\n4971 1 1\n5032 0 1\n5479 0 3\n2501 0 1\n9052 1 1\n3649 0 1\n1927 1 0\n9173 0 1\n8014 0 2\n", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Artem got n stones on his birthday and now wants to give some of them to Masha. He knows that Masha cares more about the fact of receiving the present, rather than the value of that present, so he wants to give her... | [{"type": "stdin_stdout", "input": "1001000000\n", "output": "667333333\n"}, {"type": "stdin_stdout", "input": "1001100000\n", "output": "667400000\n"}, {"type": "stdin_stdout", "input": "1001001000\n", "output": "667334000\n"}, {"type": "stdin_stdout", "input": "1001001100\n", "output": "667334067\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n\"The zombies are lurking outside. Waiting. Moaning. And when they come...\"\n\n\"When they come?\"\n\n\"I hope the Wall is high enough.\"\n\nZombie attacks have hit the Wall, our line of defense in the North. Its protect... | [{"type": "stdin_stdout", "input": "10 7\n.......\n.......\n.......\n.......\n.......\n.......\n.......\n.......\n...B...\nB.BB.B.\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "10 7\n.......\n.......\n.......\n.......\n.......\n.......\n.......\n...-...\n...B...\nB.BB.B.\n", "output": "3\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToday Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the following type:\n\n 1. + ai — add... | [{"type": "stdin_stdout", "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"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor given n, l and r find the number of distinct geometrical progression, each of which contains n distinct integers not less than l and not greater than r. In other words, for each progression the following must hold: l ... | [{"type": "stdin_stdout", "input": "2 5000000 10000000\n", "output": "25000005000000\n"}, {"type": "stdin_stdout", "input": "10000000 10000000 10000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2 1 10000000\n", "output": "99999990000000\n"}, {"type": "stdin_stdout", "input": "1 10000000 11000000\n", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given positive integer number n. You should create such strictly increasing sequence of k positive numbers a1, a2, ..., ak, that their sum is equal to n and greatest common divisor is maximal.\n\nGreatest common d... | [{"type": "stdin_stdout", "input": "10000000000 5000\n", "output": "640 1280 1920 2560 3200 3840 4480 5120 5760 6400 7040 7680 8320 8960 9600 10240 10880 11520 12160 12800 13440 14080 14720 15360 16000 16640 17280 17920 18560 19200 19840 20480 21120 21760 22400 23040 23680 24320 24960 25600 26240 26880 27520 28160 2880... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn a small restaurant there are a tables for one person and b tables for two persons. \n\nIt it known that n groups of people come today, each consisting of one or two people. \n\nIf a group consist of one person, it is s... | [{"type": "stdin_stdout", "input": "30 10 10\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2\n", "output": "20\n"}, {"type": "stdin_stdout", "input": "20 4 3\n2 2 2 2 2 2 2 2 1 2 1 1 2 2 1 2 2 2 1 2\n", "output": "25\n"}, {"type": "stdin_stdout", "input": "20 4 3\n2 2 1 2 2 2 2 2 1 2 1 1 2 2 1 2 2 2 1 2\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nValery is very interested in magic. Magic attracts him so much that he sees it everywhere. He explains any strange and weird phenomenon through intervention of supernatural forces. But who would have thought that even in ... | [{"type": "stdin_stdout", "input": "150\n0 -2 1 -2 0 0 0 0 -2 0 -2 -1 0 0 2 0 1 -2 1 -1 0 0 0 2 -2 2 -1 0 0 -1 -2 0 2 0 1 0 -2 0 -2 -1 0 -2 -2 2 0 0 1 -2 -2 -1 -2 0 2 1 1 -1 1 0 -2 2 0 0 0 1 -1 0 -2 -1 0 -2 1 1 1 0 0 2 0 0 2 -1 0 0 2 0 2 0 -2 -1 1 -2 1 0 0 -2 -1 -1 0 0 2 -1 -1 -1 -1 -2 0 0 2 -1 -1 1 0 0 1 -1 0 0 -1 2 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEvery evening Vitalya sets n alarm clocks to wake up tomorrow. Every alarm clock rings during exactly one minute and is characterized by one integer ai — number of minute after midnight in which it rings. Every alarm cloc... | [{"type": "stdin_stdout", "input": "100 40 20\n148 120 37 65 188 182 199 131 97 174 157 113 62 63 193 8 72 152 138 5 90 48 133 83 197 118 123 2 181 151 53 115 78 177 144 33 196 19 85 104 77 34 173 198 136 44 3 22 86 200 23 129 68 176 29 58 121 56 79 15 159 183 171 60 141 54 158 106 30 17 116 105 190 59 36 46 169 142 16... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven an integer x. Your task is to find out how many positive integers n (1 ≤ n ≤ x) satisfy $$$n ⋅ a^n ≡ b (mod\\;p), where a, b, p$$$ are all known constants.\n\nInput\n\nThe only line contains four integers a,b,p,x ... | [{"type": "stdin_stdout", "input": "1000002 1000002 1000003 1000000000000\n", "output": "999998\n"}, {"type": "stdin_stdout", "input": "693528 398514 1000003 1000000000000\n", "output": "999995\n"}, {"type": "stdin_stdout", "input": "812415 818711 820231 1594459797584\n", "output": "1943780\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIvan is a student at Berland State University (BSU). There are n days in Berland week, and each of these days Ivan might have some classes at the university.\n\nThere are m working hours during each Berland day, and each ... | [{"type": "stdin_stdout", "input": "4 113 370\n01110100100010110100110000000011001111110000100111111001011001110111110111001011010110000110110010101010110001000\n01101001111110001010001100101100111100111001001001001101110101100110110110001110100010111011100011101110011110100\n0110011000100111101000001010110011110001111... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMancala is a game famous in the Middle East. It is played on a board that consists of 14 holes. \n\n<image>\n\nInitially, each hole has a_i stones. When a player makes a move, he chooses a hole which contains a positive n... | [{"type": "stdin_stdout", "input": "297857621 238127103 749085829 139033277 597985489 202617713 1366784327 117968155 278551059 297781685 330124279 338959601 682874531 259895291\n", "output": "5305874892\n"}, {"type": "stdin_stdout", "input": "297857621 238127103 749085829 139033277 597985489 202617713 982184715 1839327... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAllen dreams of one day owning a enormous fleet of electric cars, the car of the future! He knows that this will give him a big status boost. As Allen is planning out all of the different types of cars he will own and how... | [{"type": "stdin_stdout", "input": "40 80\n38 45 18 59 53 44 49 27 46 63 42 61 26 39 29 7 52 79 11 73 24 69 55 43 20 32 37 25 57 19 1 54 4 22 36 16 71 15 65 12\n46 1 52 54 27 3 40 10 8 41 72 17 11 44 28 73 55 65 60 13 12 43 16 26 34 53 50 15 62 35 33 48 58 42 57 80 21 51 64 74\n22 29 4 18 69 36 31 68 77 61 37 6 70 59 7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEveryone knows that chotu likes palindromic strings. One day, he found 2 ordinary strings s1 and s2. Now he wonders if he could make a palindrome by concatenating s1 and s2 in any order. i.e if s1s2 or s2s1 is a palindrom... | [{"type": "stdin_stdout", "input": "2\naba\nbaba\nxy\nzw\n\nSAMPLE", "output": "YES\nNO\n"}, {"type": "stdin_stdout", "input": "2\naba\nbaba\nxy\nzw\n\nELPMAS", "output": "YES\nNO\n"}, {"type": "stdin_stdout", "input": "2\naca\nbaab\nwy\nyw\n\nSQAMLE", "output": "NO\nYES\n"}, {"type": "stdin_stdout", "input": "2\naba\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHasan has finally finished his final exams and he decided to go in a trip among cities in Syria.\n\nThere are N cities in Syria and they are numbered from 1 to N, each city has coordinates on plane, i-th city is in (Xi, Y... | [{"type": "stdin_stdout", "input": "3\n4 -1 -1\n1 -1 -1\n0 0 41\n\nCPJSNB", "output": "35.876894\n"}, {"type": "stdin_stdout", "input": "3\n3 -1 0\n4 -1 1\n-1 3 17\n\nMBSLPD", "output": "11.343146\n"}, {"type": "stdin_stdout", "input": "3\n3 -1 0\n1 -1 1\n-1 3 17\n\nMBSLPD", "output": "11.527864\n"}, {"type": "stdin_st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether the... | [{"type": "stdin_stdout", "input": "-1 101", "output": "No\n"}, {"type": "stdin_stdout", "input": "-1 001", "output": "No\n"}, {"type": "stdin_stdout", "input": "-1 100", "output": "No\n"}, {"type": "stdin_stdout", "input": "126 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "0 000", "output": "Yes\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a sequence of k numbers: d_0,d_1,...,d_{k - 1}.\n\nProcess the following q queries in order:\n\n* The i-th query contains three integers n_i, x_i, and m_i. Let a_0,a_1,...,a_{n_i - 1} be the following sequence of ... | [{"type": "stdin_stdout", "input": "7 3\n27 18 15 18 28 73 1000000000\n1000000010 1 13\n1000000000 2 10\n1000010000 2 12", "output": "615384622\n300000000\n678578214\n"}, {"type": "stdin_stdout", "input": "7 3\n27 18 15 18 28 73 1000000000\n1000000010 1 13\n1000000000 2 10\n1000010000 2 17", "output": "615384622\n30000... | 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\nThere is a function f(x), which is initially a constant function f(x) = 0.\n\nWe will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:\n\n* An updat... | [{"type": "stdin_stdout", "input": "4\n1 -1000000000 1000000000\n1 -1000000000 0000000000\n1 -1000000000 1000000000\n2", "output": "-1000000000 2000000000\n"}, {"type": "stdin_stdout", "input": "4\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n1 -1473275407 1000000000\n2", "output": "-1000000000 3473275407\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTo make it difficult to withdraw money, a certain bank allows its customers to withdraw only one of the following amounts in one operation:\n\n* 1 yen (the currency of Japan)\n\n* 6 yen, 6^2(=36) yen, 6^3(=216) yen, ...\n... | [{"type": "stdin_stdout", "input": "182896", "output": "14\n"}, {"type": "stdin_stdout", "input": "135433", "output": "10\n"}, {"type": "stdin_stdout", "input": "58523", "output": "12\n"}, {"type": "stdin_stdout", "input": "40994", "output": "11\n"}, {"type": "stdin_stdout", "input": "33686", "output": "13\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given strings s and t, consisting of lowercase English letters. You will create a string s' by freely rearranging the characters in s. You will also create a string t' by freely rearranging the characters in t. De... | [{"type": "stdin_stdout", "input": "ratcode\nsalta", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "ratcode\nsalt`", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "rdtcoae\nsalt`", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "eaoctdr\nsalt`", "output": "Yes\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N strings of lowercase alphabet only. The i-th string is S_i. Every string is unique.\n\nProvide answers for the Q queries below. The i-th query has the following format:\n\nQuery: An integer k_i and a string p_... | [{"type": "stdin_stdout", "input": "8\nabrakatabra\nabadaba\nabracadabra\natcoder\ngrand\ncontest\nababa\na\n6\n3 abcdefghijklmnopqrstuvwxyz\n6 qwertyuiopasdfhgjklzxcvbnm\n8 poiuytrewqlkjhgfdsamnbvcxz\n2 qazwsxedcrfvtgbyhnujmikolp\n1 plokmijnuhbygvtfcrdxeszwaq\n4 mnbvcxzasdfghjklpoiuytrewq", "output": "4\n8\n2\n3\n4\n7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is data of up to 100 characters per line, consisting of half-width alphabetic character strings. Some lines are symmetric (same whether read from the left edge or the right edge). Create a program that reads this da... | [{"type": "stdin_stdout", "input": "abcba\nsx\nabcddcba\nrstrd", "output": "2\n"}, {"type": "stdin_stdout", "input": "abcca\nsw\nabcddcba\nrstrd", "output": "1\n"}, {"type": "stdin_stdout", "input": "abcca\nxt\nadcbdcba\nrdsrt", "output": "0\n"}, {"type": "stdin_stdout", "input": "abcba\nsw\nabcddcba\nrstrd", "output":... | 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\nproblem\n\nThe JOI country has one long enough road running east to west. The royal palace of JOI country is along the road, and the position along the road in JOI country is represented by the integer A. When A = 0, it r... | [{"type": "stdin_stdout", "input": "5 11 3\n-8 2\n-4 2\n-4 2\n4 1\n4 1\n2\n3\n4", "output": "-15\n-15\n15\n"}, {"type": "stdin_stdout", "input": "5 13 3\n-8 2\n-4 2\n-2 2\n0 1\n4 1\n2\n3\n4", "output": "-17\n-15\n13\n"}, {"type": "stdin_stdout", "input": "5 5 3\n-10 1\n-4 2\n-2 2\n7 2\n10 1\n1\n3\n5", "output": "-7\n-7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr. Frugal bought a new house. He feels deeply in love with his new house because it has a comfortable living room in which he can put himself completely at ease. He thinks his new house is a really good buy.\n\nBut, to h... | [{"type": "stdin_stdout", "input": "4 3\n0 1 1 1\n1 1 1 1\n1 1 1 1\n8 5\n0 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n1 0 1 1 1 1 1 1\n1 1 0 0 1 1 1 1\n0 1 1 1 0 1 1 1\n8 8\n0 1 1 0 0 1 1 0\n1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n0 1 1 0 0 1 1 0\n0 1 1 0 0 1 1 0\n1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n0 1 1 0 0 1 1 0\n10 10\n1 1 1 1 1 1 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA positive integer may be expressed as a sum of different prime numbers (primes), in one way or another. Given two positive integers n and k, you should count the number of ways to express n as a sum of k different primes... | [{"type": "stdin_stdout", "input": "24 3\n24 2\n2 1\n1 1\n4 2\n18 3\n17 1\n17 3\n17 4\n110 5\n1000 10\n1120 14\n0 0", "output": "2\n3\n1\n0\n0\n2\n1\n0\n1\n79\n200102899\n2079324314\n"}, {"type": "stdin_stdout", "input": "24 3\n24 2\n2 1\n1 1\n4 2\n33 3\n17 1\n17 3\n17 4\n100 5\n1000 10\n1120 14\n0 0", "output": "2\n3\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEstimating the Flood Risk\n\nMr. Boat is the owner of a vast extent of land. As many typhoons have struck Japan this year, he became concerned of flood risk of his estate and he wants to know the average altitude of his l... | [{"type": "stdin_stdout", "input": "20 5 2\n3 1 0\n6 2 -1", "output": "-781\n"}, {"type": "stdin_stdout", "input": "16 5 2\n2 2 3\n1 2 3", "output": "-397\n"}, {"type": "stdin_stdout", "input": "10 5 2\n1 1 10\n5 2 6", "output": "199\n"}, {"type": "stdin_stdout", "input": "16 5 2\n2 2 3\n1 2 4", "output": "-392\n"}, {"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPlayoff by all the teams\n\nThe Minato Mirai Football Association hosts its annual championship as a single round-robin tournament, in which each team plays a single match against all the others. Unlike many other round-r... | [{"type": "stdin_stdout", "input": "5\n3\n3 2\n4 1\n5 1\n3\n1\n1 2\n3\n2\n1 2\n3 2\n5\n4\n4 1\n4 2\n5 1\n5 2\n9\n3\n4 1\n4 2\n5 1\n5\n4\n3 2\n4 1\n5 1\n5 2\n9\n11\n6 1\n6 4\n7 2\n7 3\n7 4\n8 2\n8 3\n8 4\n9 1\n9 3\n9 5\n9\n10\n6 1\n6 4\n7 2\n7 1\n7 4\n8 2\n8 3\n8 4\n9 1\n9 5\n5\n6\n4 3\n2 1\n5 1\n4 4\n1 3\n2 3\n9\n1\n1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nπ (spelled pi in English) is a mathematical constant representing the circumference of a circle whose di- ameter is one unit length. The name π is said to come from the first letter of the Greek words περιφέρεια (meaning ... | [{"type": "stdin_stdout", "input": "1.1386381399168386\n0.08430864816896695\n0.0", "output": "3/1\n16/5\n"}, {"type": "stdin_stdout", "input": "0.5656950408067312\n0.06616503278329884\n0.0", "output": "3/1\n16/5\n"}, {"type": "stdin_stdout", "input": "0.9300839575225542\n0.09342351193849237\n0.0", "output": "3/1\n16/5\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTraining is indispensable for achieving good results at ICPC. Rabbit wants to win at ICPC, so he decided to practice today as well.\n\nToday's training is to use the Amidakuji to improve luck by gaining the ability to rea... | [{"type": "stdin_stdout", "input": "10 22 1 0 4\n1 -1\n59 3", "output": "0.834647\n"}, {"type": "stdin_stdout", "input": "15 17 5 0 1\n1 1\n-1 3", "output": "0.875000\n"}, {"type": "stdin_stdout", "input": "15 22 3 0 1\n0 0\n-1 1", "output": "0.904762\n"}, {"type": "stdin_stdout", "input": "14 22 1 0 1\n0 1\n41 3", "ou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem statement\n\nJota made a scale as shown in the figure below using a stick with a length of $ 2L $.\n\n<image>\n\nThe rods are evenly spaced with $ 2L + 1 $ holes, from left to right: $ -L, -L + 1, \\ cdots, -1, 0,... | [{"type": "stdin_stdout", "input": "3\n3\n12 -1\n1 -1\n0 1", "output": "3\n-12 -1\n-1 -1\n0 1\n"}, {"type": "stdin_stdout", "input": "3\n3\n12 -1\n2 -1\n0 1", "output": "3\n-12 -1\n-2 -1\n0 1\n"}, {"type": "stdin_stdout", "input": "3\n3\n1 -1\n4 -1\n0 0", "output": "3\n-1 -1\n-4 -1\n0 0\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA complete binary tree is a binary tree in which every internal node has two children and all leaves have the same depth. A binary tree in which if last level is not completely filled but all nodes (leaves) are pushed acr... | [{"type": "stdin_stdout", "input": "5\n-3 -1 -1 1 -3", "output": "node 1: key = -3, left key = -1, right key = -1, \nnode 2: key = -1, parent key = -3, left key = 1, right key = -3, \nnode 3: key = -1, parent key = -3, \nnode 4: key = 1, parent key = -1, \nnode 5: key = -3, parent key = -1, \n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor $n$ dynamic arrays $A_i$ ($i = 0, 1, ..., n-1$), perform a sequence of the following operations:\n\n* pushBack($t$, $x$): Add element $x$ at the end of $A_t$.\n* dump($t$): Print all elements in $A_t$.\n* clear($t$): ... | [{"type": "stdin_stdout", "input": "3 13\n0 0 1\n0 0 3\n0 0 3\n0 2 -1\n0 0 4\n0 2 5\n1 0\n1 0\n1 2\n2 1\n1 0\n1 1\n1 2", "output": "1 3 3 4\n1 3 3 4\n-1 5\n1 3 3 4\n\n-1 5\n"}, {"type": "stdin_stdout", "input": "3 13\n0 0 1\n0 1 2\n0 0 3\n0 1 -1\n0 2 4\n0 0 5\n1 0\n1 1\n1 2\n2 2\n1 0\n1 1\n1 0", "output": "1 3 5\n2 -1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nChef has just finished the construction of his new garden. He has sown the garden with patches of the most beautiful carpet grass he could find. He has filled it with patches of different color and now he wants to evaluat... | [{"type": "stdin_stdout", "input": "3\n2 1\naa\nA`\n3 -1\naba\nbab\naab\n-1 1\naabb\nbaba\nbcaa\nbbaa", "output": "0\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n2 1\n`a\nA`\n3 -1\naba\nbab\naab\n-1 1\naabb\nbaba\nbcaa\nbbaa", "output": "0\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n2 1\na`\nA`\n3 -1\naba\nbab... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWelcome to Innopolis city. Throughout the whole year, Innopolis citizens suffer from everlasting city construction. \n\nFrom the window in your room, you see the sequence of n hills, where i-th of them has height ai. The ... | [{"type": "stdin_stdout", "input": "100\n1777 339 1249 1644 785 810 228 549 1892 464 1067 639 65 1653 981 1858 863 1980 1174 427 1710 345 309 826 31 1898 255 661 1836 443 802 195 177 752 979 1842 1689 399 568 1906 129 1571 1263 696 911 810 1877 1932 1389 1128 112 619 184 434 22 1269 386 324 1635 1440 705 300 455 1635 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two binary strings a and b of the same length. You can perform the following two operations on the string a:\n\n * Swap any two bits at indices i and j respectively (1 ≤ i, j ≤ n), the cost of this operatio... | [{"type": "stdin_stdout", "input": "91\n0010010000110001001011011011111001000110001000100111110010010001100110010111100111011111100\n1101110110000100110000100011010110111101100000011011100111111000110000001101101111100100101\n", "output": "43\n"}, {"type": "stdin_stdout", "input": "91\n001001000011000100101101101111100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nChouti is working on a strange math problem.\n\nThere was a sequence of n positive integers x_1, x_2, …, x_n, where n is even. The sequence was very special, namely for every integer t from 1 to n, x_1+x_2+...+x_t is a sq... | [{"type": "stdin_stdout", "input": "80\n24 192 896 1568 2907 4840 7475 9775 11109 29939 22475 45951 46552 36859 66787 106329 85211 94423 65627 147436 143259 128699 139277 167743 178063 192167 150133 162719 177103 160732 139859 157301 176681 199291 152867 182611 199632 199535 199905 199959\n", "output": "Yes\n1 24 39 19... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider the following problem: given an array a containing n integers (indexed from 0 to n-1), find max_{0 ≤ l ≤ r ≤ n-1} ∑_{l ≤ i ≤ r} (r-l+1) ⋅ a_i. In this problem, 1 ≤ n ≤ 2 000 and |a_i| ≤ 10^6.\n\nIn an attempt to ... | [{"type": "stdin_stdout", "input": "1979049487\n", "output": "2000\n-1 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given n numbers a_1, a_2, …, a_n. Is it possible to arrange them in a circle in such a way that every number is strictly less than the sum of its neighbors?\n\nFor example, for the array [1, 4, 5, 6, 7, 8], the ar... | [{"type": "stdin_stdout", "input": "43\n4182 3 6766 701408734 14930353 2585 39088170 1598 10947 988 28658 3524579 611 196419 378 22 14 267914297 90 17712 433494438 24157818 9227466 121394 832041 63245987 165580142 46369 2 514230 6 35 4 234 9 317812 145 102334156 75026 1346270 5702888 56 2178310\n", "output": "YES\n2 3 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array a_{1}, a_{2}, …, a_{n}. You can remove at most one subsegment from it. The remaining elements should be pairwise distinct.\n\nIn other words, at most one time you can choose two integers l and r (1 ... | [{"type": "stdin_stdout", "input": "87\n65 97 97 99 57 78 92 55 68 89 63 94 71 54 74 63 94 60 97 75 96 82 87 90 62 72 83 100 76 67 95 69 61 53 55 79 88 99 77 85 79 84 51 58 66 96 97 89 69 84 87 72 53 67 90 63 92 65 73 57 82 69 96 77 73 53 85 96 84 86 61 54 84 52 52 68 100 94 80 60 61 83 89 91 74 92 55\n", "output": "72... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPermutation p is a sequence of integers p=[p_1, p_2, ..., p_n], consisting of n distinct (unique) positive integers between 1 and n, inclusive. For example, the following sequences are permutations: [3, 4, 1, 2], [1], [1,... | [{"type": "stdin_stdout", "input": "4\n5\n1 3 4 5 5\n4\n1 1 3 4\n2\n2 2\n1\n1\n", "output": "1 3 4 5 2 \n-1\n2 1 \n1 \n"}, {"type": "stdin_stdout", "input": "4\n5\n2 3 4 5 5\n4\n1 1 3 4\n2\n2 2\n1\n1\n", "output": "2 3 4 5 1\n-1\n2 1\n1\n"}, {"type": "stdin_stdout", "input": "4\n5\n1 3 4 5 5\n4\n1 1 4 4\n2\n2 2\n1\n1\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou and your n - 1 friends have found an array of integers a_1, a_2, ..., a_n. You have decided to share it in the following way: All n of you stand in a line in a particular order. Each minute, the person at the front of... | [{"type": "stdin_stdout", "input": "4\n6 4 2\n3 9 2 3 8 4\n4 3 1\n1 13 60 4\n4 1 3\n1 0 2 1\n2 2 2\n1 2\n", "output": "8\n60\n1\n2\n"}, {"type": "stdin_stdout", "input": "4\n6 4 2\n2 7 4 5 8 7\n4 4 1\n8 13 111 4\n4 1 2\n1 2 2 1\n2 2 1\n2 3\n", "output": "7\n8\n1\n3\n"}, {"type": "stdin_stdout", "input": "4\n6 4 2\n2 7 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given three integers a ≤ b ≤ c.\n\nIn one move, you can add +1 or -1 to any of these integers (i.e. increase or decrease any number by one). You can perform such operation any (possibly, zero) number of times, you... | [{"type": "stdin_stdout", "input": "10\n3351 6383 6479\n7051 9793 9929\n1 1061 9572\n5401 5401 5865\n9777 9987 9987\n3393 7229 9665\n8014 8533 8665\n9549 9917 9998\n3336 6686 9962\n5351 8201 9241\n", "output": "208\n3239 6478 6478\n2223\n4964 9928 9928\n7\n1 1063 9567\n464\n5401 5401 5401\n210\n9987 9987 9987\n2608\n32... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMany years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had a_i burles.\n\nThe government considered a person as wealthy if he had at least x burles. To increase th... | [{"type": "stdin_stdout", "input": "4\n4 3\n6 1 2 1\n4 10\n11 9 11 18\n2 5\n4 3\n3 7\n9 4 11\n", "output": "3\n4\n0\n3\n"}, {"type": "stdin_stdout", "input": "4\n4 3\n10 1 2 1\n4 10\n11 7 11 9\n2 5\n4 3\n3 7\n9 2 9\n", "output": "4\n3\n0\n2\n"}, {"type": "stdin_stdout", "input": "4\n4 3\n10 1 3 1\n4 10\n11 7 11 9\n2 5\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a bracket sequence s of length n, where n is even (divisible by two). The string s consists of n/2 opening brackets '(' and n/2 closing brackets ')'.\n\nIn one move, you can choose exactly one bracket and mo... | [{"type": "stdin_stdout", "input": "4\n2\n)(\n4\n()()\n8\n())()()(\n10\n)))((((())\n", "output": "1\n0\n1\n3\n"}, {"type": "stdin_stdout", "input": "4\n2\n)(\n4\n)()(\n8\n())()()(\n10\n)))((((())\n", "output": "1\n1\n1\n3\n"}, {"type": "stdin_stdout", "input": "4\n2\n)(\n4\n()()\n8\n())()()(\n10\n())((()())\n", "output... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA lighthouse keeper Peter commands an army of n battle lemmings. He ordered his army to stand in a line and numbered the lemmings from 1 to n from left to right. Some of the lemmings hold shields. Each lemming cannot hold... | [{"type": "stdin_stdout", "input": "80\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 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "1776 1805 1832 1857 1880 1901 1920 1937 1953 1967 1980 1991 2001 2009 2016 2021 2025 2027 2028 2028 2028 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.\n\nThe championship consists of n-1 games, which are played according to the following rules:\n\n ... | [{"type": "stdin_stdout", "input": "2\n4\n1 2 4 3\n5\n1 1 1 1 1\n", "output": "\n3\n2 3 4 \n5\n1 2 3 4 5 \n"}, {"type": "stdin_stdout", "input": "2\n4\n2 2 4 3\n5\n1 2 1 1 1\n", "output": "4\n1 2 3 4\n5\n1 2 3 4 5\n"}, {"type": "stdin_stdout", "input": "2\n4\n2 2 4 4\n5\n1 2 1 1 1\n", "output": "4\n1 2 3 4\n5\n1 2 3 4 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFarmer John has a farm that consists of n pastures connected by one-directional roads. Each road has a weight, representing the time it takes to go from the start to the end of the road. The roads could have negative weig... | [{"type": "stdin_stdout", "input": "3\n3\n0 1 10\n2\n0 0000010000\n1\n0\n", "output": "-10\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n1\n0\n3\n0 2 15\n2\n0 1000000100\n", "output": "0\n-15\n0\n"}, {"type": "stdin_stdout", "input": "3\n3\n0 0 13\n2\n0 1000100000\n1\n0\n", "output": "-13\n0\n0\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou're playing a game called Osu! Here's a simplified version of it. There are n clicks in a game. For each click there are two outcomes: correct or bad. Let us denote correct as \"O\", bad as \"X\", then the whole play c... | [{"type": "stdin_stdout", "input": "30\n0.684344 0.306242 0.147362 0.295294 0.755047 0.7509498461990495 0.785026 0.671988 0.329806 0.832998 0.106621 0.452498 0.125067 1.5040396977864123 0.869683 0.740625 0.449522 0.751800 0.272185 0.865612 0.40967842269133364 0.416162 0.339155 0.478441 0.401937 0.626148 0.305498 1.3778... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSometimes it is hard to prepare tests for programming problems. Now Bob is preparing tests to new problem about strings — input data to his problem is one string. Bob has 3 wrong solutions to this problem. The first gives... | [{"type": "stdin_stdout", "input": "rdtevvmiqmfgvafkdypxjthzhfsbavmhgkavkfonscaokdxoscenpxrc\nijbvueenzsmgkmkrskjspvfchwkqdglkxnrdtevvmiqmfgvafkdypxjthz\nkqdglkxnrdtevvmiqmfgvafkdypxjthzhfsbavmhgkavkfonscaokdxoscenpxrcivydtkrxjy\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "iefouqzxoyuieqdzalfktehtvdbvjmeu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya's got a birthday coming up and his mom decided to give him an array of positive integers a of length n.\n\nVasya thinks that an array's beauty is the greatest common divisor of all its elements. His mom, of course, ... | [{"type": "stdin_stdout", "input": "25 7\n67 18 36 85 64 22 32 66 17 64 66 65 119 36 16 52 19 70 38 51 17 32 85 16 64\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "25 7\n67 18 36 85 64 22 32 66 17 64 66 65 82 36 16 52 19 70 38 51 17 32 85 16 64\n", "output": "16"}, {"type": "stdin_stdout", "input": "25 7\n6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThumbelina has had an accident. She has found herself on a little island in the middle of a swamp and wants to get to the shore very much.\n\nOne can get to the shore only by hills that are situated along a straight line ... | [{"type": "stdin_stdout", "input": "200 72 29\n201 145 169 163 32 126 131 71 26 130 2 61 110 17 179 114 79 30 192 91 141 70 101 119 185 66 72 76 164 144 106 162 122 146 119 181 184 61 131 131 140 152 60 65 183 154 32 33 108 77 29 102 67 5 125 26 126 104 20 89 183 21 126 195 198 24 123 173 135 164 141 32\n160 65 136 22 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSereja has an n × m rectangular table a, each cell of the table contains a zero or a number one. Sereja wants his table to meet the following requirement: each connected component of the same values forms a rectangle with... | [{"type": "stdin_stdout", "input": "21 10 8\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n0 0 1 1 1 0 0 0 0 0\n0 0 0 1 1 0 0 0 0 0\n1 1 1 0 0 1 1 1 1 1\n0 0 0 1 1 0 0 0 0 0\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n0 0 0 1 1 0 0 0 0 0\n1 0 1 0 0 1 1 1 1 1\n0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOn a certain meeting of a ruling party \"A\" minister Pavel suggested to improve the sewer system and to create a new pipe in the city.\n\nThe city is an n × m rectangular squared field. Each square of the field is either... | [{"type": "stdin_stdout", "input": "9 37\n.......#................#.##...#.....\n..#......................##..........\n..#......#.........#.................\n..........#..#..#..#...........#.....\n...#............#..##.#.....##.......\n......................#..............\n......#........##....#......#........\n........ | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.\n\nThere are n toy cars. Each pair... | [{"type": "stdin_stdout", "input": "4\n-1 3 3 3\n6 -1 3 -1\n2 3 -1 3\n3 3 3 -1\n", "output": "0\n\n"}, {"type": "stdin_stdout", "input": "4\n-1 3 3 3\n6 -1 3 -1\n2 1 -1 3\n3 3 3 -1\n", "output": "0\n\n"}, {"type": "stdin_stdout", "input": "4\n-1 3 3 3\n6 -1 3 -1\n2 3 -1 2\n3 3 3 -1\n", "output": "0\n\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAndrew often reads articles in his favorite magazine 2Char. The main feature of these articles is that each of them uses at most two distinct letters. Andrew decided to send an article to the magazine, but as he hasn't wr... | [{"type": "stdin_stdout", "input": "31\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "31\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLesha plays the recently published new version of the legendary game hacknet. In this version character skill mechanism was introduced. Now, each player character has exactly n skills. Each skill is represented by a non-n... | [{"type": "stdin_stdout", "input": "1 1000000000 1000 1000 1000000000000000\n1000000000\n", "output": "1000000001000\n1000000000 \n"}, {"type": "stdin_stdout", "input": "1 1000001000 1000 1000 1000000000000000\n1000000000\n", "output": "1000001001000\n1000001000\n"}, {"type": "stdin_stdout", "input": "1 1000000000 1000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA remote island chain contains n islands, labeled 1 through n. Bidirectional bridges connect the islands to form a simple cycle — a bridge connects islands 1 and 2, islands 2 and 3, and so on, and additionally a bridge co... | [{"type": "stdin_stdout", "input": "12\n0 1 2 3 4 5 6 7 8 9 10 11\n1 2 9 8 6 4 5 10 3 7 0 11\n1 2\n2 3\n3 4\n4 5\n4 6\n6 7\n3 8\n8 9\n9 10\n2 11\n11 12\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "12\n0 1 2 3 4 5 6 7 8 9 10 11\n1 2 9 8 6 4 5 10 3 7 0 11\n1 2\n2 3\n3 4\n4 5\n4 6\n6 7\n3 8\n8 9\n9 10\n8 11\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nInternational Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of form IAO'y, where y stands for some number of consequent last digits of the current year. ... | [{"type": "stdin_stdout", "input": "9\nIAO'0\nIAO'00\nIAO'000\nIAO'0000\nIAO'00000\nIAO'000000\nIAO'0000000\nIAO'00000000\nIAO'000000000\n", "output": "1990\n2000\n3000\n10000\n100000\n1000000\n10000000\n100000000\n1000000000\n"}, {"type": "stdin_stdout", "input": "5\nIAO'15\nIAO'2015\nIAO'1\nIAO'9\nIAO'0\n", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToday Pari and Arya are playing a game called Remainders.\n\nPari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the value <image>. There are n ancient numbers c1, c2, ..., cn and Pari... | [{"type": "stdin_stdout", "input": "61 531012\n698043 698043 698043 963349 698043 698043 698043 963349 698043 698043 698043 963349 698043 698043 698043 698043 966694 698043 698043 698043 698043 698043 698043 636247 698043 963349 698043 698043 698043 698043 697838 698043 963349 698043 698043 966694 698043 698043 698043 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp is a beginner programmer. He is studying how to use a command line.\n\nPolycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp wants to run a single de... | [{"type": "stdin_stdout", "input": "2 1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac\n1\n", "output": "Yes\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp's workday lasts exactly n minutes. He loves chocolate bars and can eat one bar in one minute. Today Polycarp has k bars at the beginning of the workday.\n\nIn some minutes of the workday Polycarp has important th... | [{"type": "stdin_stdout", "input": "100 89\n0011011110011111111010111101101100101111111111011011111111110111001111101111111101111011111011101110\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "100 19\n0011011110011111111010111101101100111111111111011011111111110111101111101111111101111011111011101100\n", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOn one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular conv... | [{"type": "stdin_stdout", "input": "100000 180\n", "output": "2 1 100000\n"}, {"type": "stdin_stdout", "input": "100000 227\n", "output": "2 1 100000\n"}, {"type": "stdin_stdout", "input": "100010 227\n", "output": "2 1 100010\n"}, {"type": "stdin_stdout", "input": "100100 245\n", "output": "2 1 100100\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array of n integer numbers. Let sum(l, r) be the sum of all numbers on positions from l to r non-inclusive (l-th element is counted, r-th element is not counted). For indices l and r holds 0 ≤ l ≤ r ≤ n. ... | [{"type": "stdin_stdout", "input": "100\n2 1 -2 -1 -2 0 -1 -2 1 2 0 1 0 -2 -1 -2 0 2 0 1 -2 -2 2 0 -2 2 -2 0 2 -1 2 0 -1 0 -2 2 -1 -1 -2 -1 0 -2 2 0 -2 -2 -2 -1 1 0 -2 -1 2 -1 -4 0 -1 1 1 2 -2 1 -2 1 2 2 -2 1 -2 0 -1 -1 -2 -2 1 0 -1 -1 2 0 2 0 -1 2 1 -1 2 0 2 1 1 1 -1 -1 1 -2 0 0 -2 0\n", "output": "2 78 92\n"}, {"type... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently Luba learned about a special kind of numbers that she calls beautiful numbers. The number is called beautiful iff its binary representation consists of k + 1 consecutive ones, and then k consecutive zeroes.\n\nSo... | [{"type": "stdin_stdout", "input": "32640\n", "output": "32640\n"}, {"type": "stdin_stdout", "input": "97920\n", "output": "32640\n"}, {"type": "stdin_stdout", "input": "38304\n", "output": "2016\n"}, {"type": "stdin_stdout", "input": "89408\n", "output": "8128\n"}, {"type": "stdin_stdout", "input": "10080\n", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWelcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one can find the solution of the... | [{"type": "stdin_stdout", "input": "100\nmntyyerijtaaditeyqvxstrwxoxglpaubigaggtrepaegniybvfmssawvhrgjjhwwkwuqhtyrimxvolcstyllbhlcursvgfafpts\nbsgmhsgavsbgtwiiqaigmtyjxihphxdlseeajfywugawigrjruttuykthfrvwagpcsxlxsopnarqcvetnbtvfrvlyymwoyelrlta\n", "output": "300\n100 10 1 100 3 1 100 21 1 100 16 1 100 66 1 100 11 1 100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA bracket sequence is a string containing only characters \"(\" and \")\".\n\nA regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters \"1\" and... | [{"type": "stdin_stdout", "input": "10\n()()(\n)((\n)()(((()(\n(((()(\n)(()((\n))\n()()()()\n))()))((\n)\n))())(\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10\n()()(\n)((\n)()((((((\n(((()(\n)(()((\n))\n()()()()\n))()))((\n)\n))())(\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10\n()()(\n)((\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter setting up the area and his toys. Chandu is up for playing his very first game. His first game is played on a N X N board with some initial stones placed on each cell. He can move each stone in all four direction i... | [{"type": "stdin_stdout", "input": "100000 344\n9489 61424 27955 42780 24866 60662 35985 72602 7178 66039 20165 80878 65110 53338 89723 12426 82120 81954 41970 39397 58255 82537 3650 28876 93078 72976 12227 6751 83149 67385 30224 11174 57709 8346 76772 99593 37316 51065 36529 82364 8508 25414 90342 74569 42932 48144 50... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Dipu is a small kid and like all the other kids, he likes to play, but he plays with numbers (He is extraordinary you know). Now-a-days Dipu has some extra interest in odd numbers. So, he says that a number N is in... | [{"type": "stdin_stdout", "input": "11\n16 169\n36 255\n4 363\n27 441\n48 624\n120 1532\n111 21749\n122 1599\n226 1200\n484 484\n1086 1717", "output": "10\n10\n18\n16\n18\n29\n137\n28\n19\n1\n9\n"}, {"type": "stdin_stdout", "input": "11\n16 169\n36 255\n4 363\n27 441\n48 624\n120 1129\n111 21749\n122 1599\n226 1200\n48... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nView Russian Translation\n\nTom works in a public library in his town. Today, a completely new set of N books is arriving to the library and they have to be placed on shelves, which are initially empty.\n\nA single shelf ... | [{"type": "stdin_stdout", "input": "1000\ntfumsrmyoadegxickhab\nddjztukvwtpmdumzuybz\nzmizvpyznukwuocziunj\ngntnlzscuzkpeawoarjm\nsfzpdgshrxwncpdzvfhg\nimqtoqrqxzkeiveqdmym\nuqiijkjaemxwwamypieq\ntadclmjjmtmnafooasgm\nnyvtmaymqmqfjajmeofu\ndnwwsbuqnoamyjoyzizs\nystwgabzcqvqbhhjvyik\nttojlqvkhbdnppfsnlah\necnxakfrbirmun... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.