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\nDo you know the story about the three musketeers? Anyway, you must help them now.\n\nRichelimakieu is a cardinal in the city of Bearis. He found three brave warriors and called them the three musketeers. Athos has strengt... | [{"type": "stdin_stdout", "input": "30\n34938093 71279712 25853338\n29827587 21741565 52179990 30235076 83272806 10815432 98887688 94542207 99870240 97586453 21739186 30460781 75347784 50711354 12162179 74306503 97398492 88466481 52489587 67579359 53177356 75077523 86044366 14405531 73916272 78242091 49321886 41937821 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKris works in a large company \"Blake Technologies\". As a best engineer of the company he was assigned a task to develop a printer that will be able to print horizontal and vertical strips. First prototype is already bui... | [{"type": "stdin_stdout", "input": "17 1 1\n2 1 1000000000\n", "output": "1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n"}, {"type": "stdin_stdout", "input": "10 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasiliy is fond of solving different tasks. Today he found one he wasn't able to solve himself, so he asks you to help.\n\nVasiliy is given n strings consisting of lowercase English letters. He wants them to be sorted in ... | [{"type": "stdin_stdout", "input": "10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\naaaaaabaaaab\nab\naab\naaab\naaaab\naaaaab\naaaaaab\naaaaaaab\naaaaaaaab\naaaaaaaaab\n", "output": "8000000000\n"}, {"type": "stdin_stdout", "input": "10\n1000000000 100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n workers in a company, each of them has a unique id from 1 to n. Exaclty one of them is a chief, his id is s. Each worker except the chief has exactly one immediate superior.\n\nThere was a request to each of t... | [{"type": "stdin_stdout", "input": "10 10\n3 0 0 0 0 0 1 1 1 0\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 10\n3 0 0 0 0 0 1 0 1 0\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "10 10\n3 0 0 0 0 1 1 0 1 0\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 10\n3 0 0 0 1 1 1 0 1 0\n", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\na is an array of n positive integers, all of which are not greater than n.\n\nYou have to process q queries to this array. Each query is represented by two numbers p and k. Several operations are performed in each query; ... | [{"type": "stdin_stdout", "input": "50\n49 21 50 31 3 19 10 40 20 5 47 12 12 30 5 4 5 2 11 23 5 39 3 30 19 3 23 40 4 14 39 50 45 14 33 37 1 15 43 30 45 23 32 3 9 17 9 5 14 12\n50\n36 29\n44 24\n38 22\n30 43\n15 19\n39 2\n13 8\n29 50\n37 18\n32 19\n42 39\n20 41\n14 11\n4 25\n14 35\n17 23\n1 29\n3 19\n8 6\n26 31\n9 46\n3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n students who have taken part in an olympiad. Now it's time to award the students.\n\nSome of them will receive diplomas, some wiil get certificates, and others won't receive anything. Students with diplomas an... | [{"type": "stdin_stdout", "input": "2106623580587 109123020071\n", "output": "9 982107180639 1124516399939 "}, {"type": "stdin_stdout", "input": "1000000000000 499999999999\n", "output": "1 499999999999 500000000000\n"}, {"type": "stdin_stdout", "input": "1000000000000 1\n", "output": "250000000000 250000000000 5000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is an interactive problem.\n\nYou are given a sorted in increasing order singly linked list. You should find the minimum integer in the list which is greater than or equal to x.\n\nMore formally, there is a singly li... | [{"type": "stdin_stdout", "input": "10 3 632584719\n378382911 9\n978367651 -1\n176599346 7\n557138623 8\n441019502 4\n823417558 2\n244832688 10\n702148024 6\n385598339 5\n357778234 1\n", "output": "? 3\n? 9\n! 978367651\n"}, {"type": "stdin_stdout", "input": "10 3 632584719\n378382911 9\n978367651 -1\n176599346 7\n5571... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a set of n points on the plane. A line containing the origin is called good, if projection of the given set to this line forms a symmetric multiset of points. Find the total number of good lines.\n\nMultiset... | [{"type": "stdin_stdout", "input": "50\n-38 -107\n-34 -75\n-200 -143\n-222 -139\n-34 55\n-102 -79\n48 -99\n2 -237\n-118 -167\n-56 -41\n10 17\n68 -89\n-32 41\n-100 -93\n84 -1\n86 -15\n46 -145\n-58 -117\n8 31\n-36 -61\n-12 21\n-116 79\n88 -205\n70 -103\n-78 -37\n106 -5\n-96 -201\n-60 -103\n-54 45\n-138 -177\n-178 -47\n-1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSince Grisha behaved well last year, at New Year's Eve he was visited by Ded Moroz who brought an enormous bag of gifts with him! The bag contains n sweet candies from the good ol' bakery, each labeled from 1 to n corresp... | [{"type": "stdin_stdout", "input": "1100000000000000000 1000000000000000000\n", "output": "1152921504606846975\n"}, {"type": "stdin_stdout", "input": "1100000000010000000 1000000000000000000\n", "output": "1152921504606846975\n"}, {"type": "stdin_stdout", "input": "1005016953863700545 1459461610595482691\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPuchi and Ghissi are playing a game with strings. As Ghissi is a champion at strings, Puchi decides to challenge her. He gives Ghissi a string S and an integer K . The objective for Ghissi is to find a substring of S s... | [{"type": "stdin_stdout", "input": "10\njmwyirufdtlimcxeqtjhzkgwxrcwqkhzxnmofjbotrfvgoshptrpsuoeqwslvfdvirjleimwhoubxtwmsnamwqbhyzvvhnpticrgdqcpwfvujnmxgtxscgzykwlsdspqtbqfoljoenrdfizkwtrwsymuwsiphwfwuromadxluebvuxqzbwbjctfnrwqlkebssxrcgppwjhdqbaqnxqrkdphqrvhirqasyoqxicucdbxvqmazbqqvrxvxfzczfopiqvbamfxlacnqjklqrqtngdfo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPankaj is a very intelligent student studying in one of the best colleges of this country. He's good enough to challenge the smartest minds in the country, but even the smart ones make mistakes and so did Pankaj - he fell... | [{"type": "stdin_stdout", "input": "99\n380 -405 351 -268 -88 375 -367 -496 15 276 495 -183 421 398 -140 376 378 -481 -90 55 209 -105 -497 -330 -120 364 224 -258 50 -419 497 -122 319 -57 -478 452 -465 -195 -60 289 -158 -235 162 -112 492 -354 377 437 -54 -177 430 365 -256 -64 -148 133 198 63 150 96 458 106 116 270 199 -... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nUtkarsh's mother recently received N piles of books as a gift from someone. The i^th pile contains Bi books.\n\nShe neither wants to keep the voluminous books with herself nor she wants to throw them away. So, she decide... | [{"type": "stdin_stdout", "input": "10\n1000\n772 471 331 119 775 107 645 356 638 975 867 164 316 61 22 487 523 873 955 185 28 413 742 304 317 154 702 877 682 460 393 1582 687 52 696 408 323 190 134 577 402 311 347 171 761 130 106 101 236 505 562 804 672 521 814 173 978 950 396 716 757 327 448 279 724 612 27 443 721 66... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi loves gold coins. He gains 1000 happiness points for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)\n\nTakahashi has X yen. If he exchanges his ... | [{"type": "stdin_stdout", "input": "1000000001", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "1100000000", "output": "2200000000\n"}, {"type": "stdin_stdout", "input": "1000000101", "output": "2000000100\n"}, {"type": "stdin_stdout", "input": "1000000000", "output": "2000000000"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nChokudai made a rectangular cake for contestants in DDCC 2020 Finals.\n\nThe cake has H - 1 horizontal notches and W - 1 vertical notches, which divide the cake into H \\times W equal sections. K of these sections has a s... | [{"type": "stdin_stdout", "input": "13 21 106\n.....................\n.####.####.####.####.\n..#.#..#.#.#....#....\n..#.#..#.#.#....#....\n....#....#.#.#..#.#..\n.####.####.####.####.\n.....................\n.####.####.####.####.\n....#.#..#....#.#..#.\n.####.#..#.####.#..#.\n.#....#..#.#....#..#.\n.####.####.####.####... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKen loves ken-ken-pa (Japanese version of hopscotch). Today, he will play it on a directed graph G. G consists of N vertices numbered 1 to N, and M edges. The i-th edge points from Vertex u_i to Vertex v_i.\n\nFirst, Ken ... | [{"type": "stdin_stdout", "input": "6 8\n1 2\n2 1\n3 4\n4 11\n5 0\n1 5\n1 5\n4 6\n1 4", "output": "-1\n"}, {"type": "stdin_stdout", "input": "6 8\n1 4\n2 3\n3 4\n4 5\n5 1\n1 4\n1 5\n4 1\n1 6", "output": "-1\n"}, {"type": "stdin_stdout", "input": "6 8\n1 2\n2 1\n3 4\n4 6\n5 0\n1 5\n1 5\n4 6\n1 4", "output": "-1\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRingo is giving a present to Snuke.\n\nRingo has found out that Snuke loves yakiniku (a Japanese term meaning grilled meat. yaki: grilled, niku: meat). He supposes that Snuke likes grilled things starting with `YAKI` in J... | [{"type": "stdin_stdout", "input": "YAKINIKU", "output": "Yes"}, {"type": "stdin_stdout", "input": "UKINIKAY", "output": "No\n"}, {"type": "stdin_stdout", "input": "UAKOYAKI", "output": "No\n"}, {"type": "stdin_stdout", "input": "NKIUIKAY", "output": "No\n"}, {"type": "stdin_stdout", "input": "IKAYOKAU", "output": "No\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe problem set at CODE FESTIVAL 20XX Finals consists of N problems.\n\nThe score allocated to the i-th (1β¦iβ¦N) problem is i points.\n\nTakahashi, a contestant, is trying to score exactly N points. For that, he is decidin... | [{"type": "stdin_stdout", "input": "740", "output": "2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n"}, {"type": "stdin_stdout", "input": "370", "output": "1\n2\n3\n4\n5\n6\n7\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a program which computes the area of a shape represented by the following three lines:\n\n$y = x^2$\n$y = 0$\n$x = 600$\n\n\n\nIt is clear that the area is $72000000$, if you use an integral you learn in high school... | [{"type": "stdin_stdout", "input": "20\n100", "output": "68440000\n55000000\n"}, {"type": "stdin_stdout", "input": "20\n120", "output": "68440000\n51840000\n"}, {"type": "stdin_stdout", "input": "20\n150", "output": "68440000\n47250000\n"}, {"type": "stdin_stdout", "input": "20\n200", "output": "68440000\n40000000\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe phantom thief \"Lupin IV\" is told by the beautiful \"Fujiko Mine\", a descendant of the Aizu clan, that the military funds left by the Aizu clan are sleeping in Aizuwakamatsu city. According to a report by Lupine's l... | [{"type": "stdin_stdout", "input": "5\n13 199 1\n93 1000 1\n37 350 10\n27 300 2\n123 200 1100", "output": "93 37 27 13 123\n"}, {"type": "stdin_stdout", "input": "5\n11 199 0\n93 1000 1\n37 350 10\n27 300 2\n123 200 1100", "output": "93 37 27 11 123\n"}, {"type": "stdin_stdout", "input": "5\n11 91 0\n124 1000 1\n37 350... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are the planning manager of an animation production company. What animation production companies produce these days is not limited to animation itself. Related products, such as figures of characters and character son... | [{"type": "stdin_stdout", "input": "4\nakzakr 2 1 8\nfnmyi 5 2 3 4 6 9\ntsnukk 5 2 3 4 7 9\nyskwcnt 6 3 4 7 8 9 10\n4\nakzakr 1 2\nfnmyi 3 10 11 12\ntsnukk 2 1 8\nyskwcnt 2 1 8\n5\nknmmdk 2 13 19\nakmhmr 4 13 15 19 22\nmksyk 6 3 7 12 13 15 19\nskrkyk 3 1 4 8\ntmemm 3 1 17 24\n5\nknmmdk 5 5 6 16 18 26\nakmhmr 9 3 4 7 11... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDescription\n\nTHE BY DOLM @ STER is a training simulation game scheduled to be released on EXIDNA by 1rem on April 1, 2010. For the time being, it probably has nothing to do with an arcade game where the network connecti... | [{"type": "stdin_stdout", "input": "3 10\nDobkeradops\n7 5 23 10\nPataPata\n1 0 2 1\ndop\n1 7 11 21\n2 300\nBydp System ahplA\n2 11 4 7\nGreen Inferno\n300 300 300 300", "output": "210\n1650\n"}, {"type": "stdin_stdout", "input": "3 10\nDobkeradops\n7 5 23 10\nPataPata\n1 1 2 1\ndop\n1 7 11 14\n2 300\nBydp System Alpha... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nH --Bit Operation Game\n\nGiven a rooted tree with N vertices. The vertices are numbered from 0 to N β 1, and the 0th vertex represents the root. `T = 0` for the root, but for the other vertices\n\n* `T = T & X;`\n* `T = ... | [{"type": "stdin_stdout", "input": "6 9\nT=T|X\nT=T|Y\nT=T|Y\nT=T^Y\nT=T&X\n0 1\n0 2\n1 3\n1 4\n2 5\n5 6\n3 5\n0 0", "output": "4\n6\n0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "6 9\nT=T|X\nT=T|Y\nT=T|Y\nT=T^Y\nT=T&X\n0 1\n0 2\n1 3\n1 4\n2 5\n5 6\n4 5\n0 0", "output": "4\n4\n0\n0\n0\n0\n0\n0\n0\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem\n\nMr. ukuku1333 is a little sloppy, so when I expanded the product of the linear expressions of x, I couldn't figure out the original linear expression.\nGiven the nth degree polynomial of x, factor it into the p... | [{"type": "stdin_stdout", "input": "x^5+15x^4+85x^3+225x^2+274x+120", "output": "(x+1)(x+2)(x+3)(x+4)(x+5)"}, {"type": "stdin_stdout", "input": "x^3-81x^2-1882x-1800", "output": "(x-100)(x+1)(x+18)"}, {"type": "stdin_stdout", "input": "x^2+4x+3", "output": "(x+1)(x+3)\n"}, {"type": "stdin_stdout", "input": "x^2+3x+2", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDepth-first search (DFS) follows the strategy to search βdeeperβ in the graph whenever possible. In DFS, edges are recursively explored out of the most recently discovered vertex $v$ that still has unexplored edges leavin... | [{"type": "stdin_stdout", "input": "6\n1 2 2 3\n2 2 3 4\n3 1 5\n4 1 6\n5 1 6\n6 -1", "output": "1 1 12\n2 2 11\n3 3 8\n4 9 10\n5 4 7\n6 5 6\n"}, {"type": "stdin_stdout", "input": "6\n1 2 2 3\n2 2 4 4\n3 1 5\n4 1 6\n5 1 6\n6 -1", "output": "1 1 12\n2 2 7\n3 8 11\n4 3 6\n5 9 10\n6 4 5\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConstruct a dice from a given sequence of integers in the same way as Dice I.\n\nYou are given integers on the top face and the front face after the dice was rolled in the same way as Dice I. Write a program to print an i... | [{"type": "stdin_stdout", "input": "1 2 3 4 14 -1\n3\n1 3\n1 4\n3 2", "output": "14\n2\n-1\n"}, {"type": "stdin_stdout", "input": "1 2 3 4 5 12\n3\n3 2\n1 3\n3 2", "output": "12\n5\n12\n"}, {"type": "stdin_stdout", "input": "1 2 3 4 5 16\n3\n3 2\n1 3\n3 2", "output": "16\n5\n16\n"}, {"type": "stdin_stdout", "input": "1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a positive integer n.\n\nLet S(x) be sum of digits in base 10 representation of x, for example, S(123) = 1 + 2 + 3 = 6, S(0) = 0.\n\nYour task is to find two integers a, b, such that 0 β€ a, b β€ n, a + b = n ... | [{"type": "stdin_stdout", "input": "1000000000000\n", "output": "109\n"}, {"type": "stdin_stdout", "input": "999999999992\n", "output": "200\n"}, {"type": "stdin_stdout", "input": "290687942106\n", "output": "153\n"}, {"type": "stdin_stdout", "input": "110884501982\n", "output": "146\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code 091), a colon (ASC... | [{"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "oenfnemfddbhhmig]gcd:]:mnnbj::f|ichec:|dkfnjbfjkdgoge]lfihgd[... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhen Petya went to school, he got interested in large numbers and what they were called in ancient times. For instance, he learned that the Russian word \"tma\" (which now means \"too much to be counted\") used to stand f... | [{"type": "stdin_stdout", "input": "2147483647\n2147483647\n", "output": "YES\n0\n"}, {"type": "stdin_stdout", "input": "2147483646\n2147483647\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1094841453\n1656354409\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "2147483647\n2147483646\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBob is about to take a hot bath. \n\nThere are two taps to fill the bath: a hot water tap and a cold water tap. The cold water's temperature is t1, and the hot water's temperature is t2. The cold water tap can transmit an... | [{"type": "stdin_stdout", "input": "1000000 1000000 1000000 1000000 1000000\n", "output": "1000000 1000000\n"}, {"type": "stdin_stdout", "input": "1000000 1000000 999999 999998 1000000\n", "output": "999999 999998\n"}, {"type": "stdin_stdout", "input": "129630 805489 631548 761110 577559\n", "output": "227930 447929\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two integers n and m (m < n). Consider a convex regular polygon of n vertices. Recall that a regular polygon is a polygon that is equiangular (all angles are equal in measure) and equilateral (all sides have... | [{"type": "stdin_stdout", "input": "2\n69 120\n11 9\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "2\n34 230\n4 15\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "2\n34 230\n4 27\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "2\n11 101\n13 4\n", "output": "NO\nNO\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a positive integer D. Let's build the following graph from it: \n\n * each vertex is a divisor of D (not necessarily prime, 1 and D itself are also included); \n * two vertices x and y (x > y) have an undi... | [{"type": "stdin_stdout", "input": "18\n36\n1 1\n1 2\n1 3\n1 6\n1 9\n1 18\n2 1\n2 2\n2 3\n2 6\n2 9\n2 18\n3 1\n3 2\n3 3\n3 6\n3 9\n3 18\n6 1\n6 2\n6 3\n6 6\n6 9\n6 18\n9 1\n9 2\n9 3\n9 6\n9 9\n9 18\n18 1\n18 2\n18 3\n18 6\n18 9\n18 18\n", "output": "1\n1\n1\n2\n1\n3\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n2\n2\n1\n1\n1\n1\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is an interactive problem. Don't forget to flush output after printing queries using cout.flush() or fflush(stdout) in C++ or similar functions in other programming languages.\n\nThere are n gift boxes in a row, numb... | [{"type": "stdin_stdout", "input": "2\n2 1\n100 1\n5 2\n99 98 100 100 100\n", "output": "? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n2\n? 1 1\n1\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Bob play a game. They have a binary string s (a string such that each character in it is either 0 or 1). Alice moves first, then Bob, then Alice again, and so on.\n\nDuring their move, the player can choose any ... | [{"type": "stdin_stdout", "input": "5\n01111001\n0000\n111111\n101010101\n011011110111\n", "output": "4\n0\n6\n3\n6\n"}, {"type": "stdin_stdout", "input": "5\n01111101\n0000\n111111\n101010101\n011011110111\n", "output": "5\n0\n6\n3\n6\n"}, {"type": "stdin_stdout", "input": "5\n01111101\n0000\n111111\n101010101\n011001... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor some time the program of rounding numbers that had been developed by the Codeforces participants during one of the previous rounds, helped the citizens of Far Far Away to convert numbers into a more easily readable fo... | [{"type": "stdin_stdout", "input": "2567340036354357844391998756110821468858185018763415770617907336824217629234299240638243305079104961\n", "output": "$2,567,340,036,354,357,844,391,998,756,110,821,468,858,185,018,763,415,770,617,907,336,824,217,629,234,299,240,638,243,305,079,104,961.00\n"}, {"type": "stdin_stdout", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array a consisting of n integers. Initially all elements of a are either 0 or 1. You need to process q queries of two kinds:\n\n * 1 x : Assign to a_x the value 1 - a_x. \n * 2 k : Print the k-th larges... | [{"type": "stdin_stdout", "input": "5 5\n0 1 0 1 0\n2 3\n2 2\n2 3\n2 1\n2 5\n", "output": "0\n1\n0\n1\n0\n"}, {"type": "stdin_stdout", "input": "5 5\n0 0 0 1 0\n2 3\n2 2\n2 3\n2 2\n2 5\n", "output": "0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "5 5\n1 0 1 0 0\n2 3\n2 3\n2 3\n2 1\n2 5\n", "output": "0\n0\n0\n1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array a of n (n β₯ 2) positive integers and an integer p. Consider an undirected weighted graph of n vertices numbered from 1 to n for which the edges between the vertices i and j (i<j) are added in the fo... | [{"type": "stdin_stdout", "input": "1\n10 195593331\n886547706 549473499 719535263 337021357 357872635 1071822623 699988186 10455 29750933 887846992\n", "output": "1760339979\n"}, {"type": "stdin_stdout", "input": "1\n10 121406599\n432485522 549473499 522487623 1009120577 698965406 845977171 252631181 1770 81120106 717... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's dive into one of the most interesting areas of magic β writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic ru... | [{"type": "stdin_stdout", "input": "# a \n # a \n\n # a \n\n\n # a \n \n # a \n \n\n # a \n\n \n # a\n \n \n # a \n\n\n \n\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a weighted undirected graph. The vertices are enumerated from 1 to n. Your task is to find the shortest path between the vertex 1 and the vertex n.\n\nInput\n\nThe first line contains two integers n and m (2... | [{"type": "stdin_stdout", "input": "10 10\n1 5 12\n2 4 140\n2 10 149\n3 6 154\n3 7 17\n3 8 226\n3 10 132\n4 10 55\n5 8 33\n7 8 173\n", "output": "1 5 8 7 3 10\n"}, {"type": "stdin_stdout", "input": "10 10\n1 5 12\n2 4 140\n2 10 149\n3 6 154\n2 7 17\n3 8 226\n3 10 136\n4 10 55\n5 8 33\n7 8 173\n", "output": "1 5 8 7 2 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate the following sum:\n\n<image>\n\nFind the sum modulo 1073741824 (230).\n\nInput\n\nTh... | [{"type": "stdin_stdout", "input": "1908 1921 1021\n", "output": "1053840771\n"}, {"type": "stdin_stdout", "input": "1676 1012 1117\n", "output": "407213319\n"}, {"type": "stdin_stdout", "input": "2000 2000 2000\n", "output": "281684196\n"}, {"type": "stdin_stdout", "input": "858 1641 1021\n", "output": "1011842644\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Vasya had n boxes with balls in the room. The boxes stood in a row and were numbered with numbers from 1 to n from left to right.\n\nOnce Vasya chose one of the boxes, let's assume that its number is i, took all ba... | [{"type": "stdin_stdout", "input": "48 19\n227460648 746912227 51958075 682685526 1080381698 666833118 492590399 167395932 678377837 125106811 638633256 713194370 386921921 34175133 704550052 220688092 499436761 495071386 57379330 137372655 0 720974146 209203457 946682102 237312198 943872065 957150897 357568282 3670067... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBessie and the cows are playing with sequences and need your help. They start with a sequence, initially containing just the number 0, and perform n operations. Each operation is one of the following:\n\n 1. Add the inte... | [{"type": "stdin_stdout", "input": "5\n2 -980\n1 2 -156\n2 641\n2 -253\n2 -514\n", "output": "-490.000000\n-646.000000\n-217.000000\n-226.000000\n-283.600000\n"}, {"type": "stdin_stdout", "input": "5\n1 1 -48\n1 1 19\n1 1 -35\n2 -67\n1 2 -13\n", "output": "-48.000000\n-29.000000\n-64.000000\n-65.500000\n-78.500000\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEverybody knows that the Berland citizens are keen on health, especially students. Berland students are so tough that all they drink is orange juice!\n\nYesterday one student, Vasya and his mates made some barbecue and th... | [{"type": "stdin_stdout", "input": "2000\naabaaabaabababbbbbbabbbbb\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2000\naaaaaabaabababbbbbbabbbbb\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2000\naaaaaabaababaabbbbbabbbbb\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2000\nbbbbbabbbbb... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya has recently found out what a digital root of a number is and he decided to share his knowledge with you.\n\nLet's assume that S(n) is the sum of digits of number n, for example, S(4098) = 4 + 0 + 9 + 8 = 21. Then t... | [{"type": "stdin_stdout", "input": "4898 3\n", "output": "3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.\n\nVasily knows that the best present is (no, it's not a contest) money. He's put n empty w... | [{"type": "stdin_stdout", "input": "10\n2 1 8 0 0 1 0 4 4 3\n", "output": "PRLPRLRPRLRPRLPRLPRLPRLPRLPRLPRLPRLRRRPRLRRPRLPRLPRLPRLRPRLPRLPRLPRLRPLRPLRPLR"}, {"type": "stdin_stdout", "input": "10\n2 0 8 0 0 1 0 4 4 3\n", "output": "PRLPRLRRPRLPRLPRLPRLPRLPRLPRLPRLRRRPRLRRPRLPRLPRLPRLRPRLPRLPRLPRLRPLRPLRPLR"}, {"type": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSchool holidays come in Berland. The holidays are going to continue for n days. The students of school βN are having the time of their lives and the IT teacher Marina Sergeyevna, who has spent all the summer busy checking... | [{"type": "stdin_stdout", "input": "100 50\n1 8\n9 12\n13 19\n20 22\n23 27\n28 31\n32 36\n36 40\n40 43\n47 47\n48 51\n51 55\n62 63\n69 77\n77 84\n85 90\n98 99\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA and B are preparing themselves for programming contests.\n\nAn important part of preparing for a competition is sharing programming knowledge from the experienced members to those who are just beginning to deal with the... | [{"type": "stdin_stdout", "input": "250000 500000\n", "output": "250000\n"}, {"type": "stdin_stdout", "input": "473686 122443\n", "output": "122443\n"}, {"type": "stdin_stdout", "input": "231646 398487\n", "output": "210044\n"}, {"type": "stdin_stdout", "input": "332019 281112\n", "output": "204377\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle girl Susie went shopping with her mom and she wondered how to improve service quality. \n\nThere are n people in the queue. For each person we know time ti needed to serve him. A person will be disappointed if the ... | [{"type": "stdin_stdout", "input": "26\n1000 4110030 64221 131521030 942374833 1003 2055015 32110 770511 16440130 263042057 32880256 128439 557559573 16051 8220066 469240078 65760513 256878 790176315 4012 2005 1027508 928528684 8030 1005954322\n", "output": "20\n"}, {"type": "stdin_stdout", "input": "26\n1000 4110030 6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two arrays A and B consisting of integers, sorted in non-decreasing order. Check whether it is possible to choose k numbers in array A and choose m numbers in array B so that any number chosen in the first a... | [{"type": "stdin_stdout", "input": "20 30\n19 29\n2 1 2 2 3 3 4 4 7 7 7 9 8 8 8 8 1 0 9 10\n6 9 9 7 9 9 9 9 5 9 9 9 9 18 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "20 30\n19 29\n2 1 2 2 2 3 4 4 7 10 7 8 8 8 8 8 9 9 9 9\n6 9 9 9 9 9 9 9 9 9 9 9 9 18 9 9 10 10 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis Christmas Santa gave Masha a magic picture and a pencil. The picture consists of n points connected by m segments (they might cross in any way, that doesn't matter). No two segments connect the same pair of points, a... | [{"type": "stdin_stdout", "input": "100 50\n66 3\n92 79\n9 44\n84 45\n30 63\n30 20\n33 86\n8 83\n40 75\n7 36\n91 4\n76 88\n77 76\n28 27\n1 52\n41 57\n8 23\n34 75\n50 15\n86 68\n36 98\n30 84\n37 62\n22 4\n6 45\n72 80\n98 74\n78 84\n1 54\n99 27\n84 91\n78 7\n80 61\n67 48\n51 52\n36 72\n97 87\n25 17\n20 80\n20 39\n72 5\n2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJohnny drives a truck and must deliver a package from his hometown to the district center. His hometown is located at point 0 on a number line, and the district center is located at the point d.\n\nJohnny's truck has a ga... | [{"type": "stdin_stdout", "input": "281 12 23\n178 650197\n129 288456\n34 1664910\n43 683515\n305 957083\n103 724815\n105 308008\n252 1280706\n74 87088\n229 146026\n85 241042\n35 39127\n62 47524\n217 760274\n156 562141\n10 209057\n50 714473\n201 164128\n97 624021\n120 102709\n147 388268\n317 1546753\n190 1448117\n", "o... | 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\nPolandBall is a young, clever Ball. He is interested in prime numbers. He has stated a following hypothesis: \"There exists such a positive integer n that for each positive integer m number nΒ·m + 1 is a prime number\".\n\... | [{"type": "stdin_stdout", "input": "1447\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1127\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1722\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1332\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1261\n", "output": "1\n"}, {"type": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array a consisting of n positive integers. You pick two integer numbers l and r from 1 to n, inclusive (numbers are picked randomly, equiprobably and independently). If l > r, then you swap values of l an... | [{"type": "stdin_stdout", "input": "20\n128 33 9 1 50 37 12 44 26 69 24 10 17 4 17 41 11 26 10 14\n", "output": "7.005\n"}, {"type": "stdin_stdout", "input": "20\n49 33 9 8 50 21 12 44 23 39 24 10 17 4 17 40 24 19 27 21\n", "output": "7.0100"}, {"type": "stdin_stdout", "input": "20\n49 33 9 8 50 21 12 44 23 49 24 10 17... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHave you ever tried to explain to the coordinator, why it is eight hours to the contest and not a single problem has been prepared yet? Misha had. And this time he has a really strong excuse: he faced a space-time paradox... | [{"type": "stdin_stdout", "input": "12 12 12 11 12\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "11 59 59 11 12\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "11 59 59 12 11\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "3 30 45 10 11\n", "output": "YES\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two positive integer numbers x and y. An array F is called an y-factorization of x iff the following conditions are met:\n\n * There are y elements in F, and all of them are integer numbers; \n * <image>. ... | [{"type": "stdin_stdout", "input": "1\n524288 1000000\n", "output": "645043186\n"}, {"type": "stdin_stdout", "input": "1\n983675 1000000\n", "output": "661876874\n"}, {"type": "stdin_stdout", "input": "1\n65536 1000000\n", "output": "928522471\n"}, {"type": "stdin_stdout", "input": "1\n36157 1000000\n", "output": "2585... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's denote a m-free matrix as a binary (that is, consisting of only 1's and 0's) matrix such that every square submatrix of size m Γ m of this matrix contains at least one zero. \n\nConsider the following problem:\n\nYo... | [{"type": "stdin_stdout", "input": "3\n21\n0\n1\n", "output": "5 2\n1 1\n-1\n"}, {"type": "stdin_stdout", "input": "1\n297540\n", "output": "546 22\n"}, {"type": "stdin_stdout", "input": "1\n1015463691\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1\n420441920\n", "output": "-1\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA rectangle with sides A and B is cut into rectangles with cuts parallel to its sides. For example, if p horizontal and q vertical cuts were made, (p + 1) β
(q + 1) rectangles were left after the cutting. After the cuttin... | [{"type": "stdin_stdout", "input": "2\n2 2 20\n2 10 40\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "2\n2 2 20\n1 10 11\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2\n2 2 35\n1 10 11\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2\n2 3 20\n2 4 40\n", "output": "6\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have to handle a very complex water distribution system. The system consists of n junctions and m pipes, i-th pipe connects junctions x_i and y_i.\n\nThe only thing you can do is adjusting the pipes. You have to choos... | [{"type": "stdin_stdout", "input": "4\n3 -10 6 1\n5\n1 2\n3 2\n2 4\n3 4\n3 1\n", "output": "Possible\n-3\n-7\n0\n1\n0\n"}, {"type": "stdin_stdout", "input": "4\n3 -10 6 1\n5\n1 2\n3 2\n2 4\n3 4\n3 1\n", "output": "Possible\n-3\n-7\n0\n1\n0\n"}, {"type": "stdin_stdout", "input": "4\n3 -10 6 1\n5\n1 4\n3 2\n2 4\n3 4\n3 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nChandu is a very strict mentor. He always gives a lot of work to his interns. So his interns decided to kill him. There is a party in the office on Saturday Night, and the interns decided to kill him on the same day. In t... | [{"type": "stdin_stdout", "input": "10000\n50475\n28475\n16797\n79790\n18251\n56915\n35705\n13557\n80986\n8847\n83145\n52539\n85820\n11696\n29001\n94572\n86370\n56866\n80823\n7870\n8239\n45191\n79881\n30587\n93804\n33155\n9721\n42472\n64506\n70429\n72316\n45387\n41663\n45404\n86055\n93998\n96046\n58187\n15011\n52946\n8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToday is the first class after a long vacation and as always Bagha woke up late. His friend, Nathumama has a motorcycle which they can use to reach class on time. However, Nathumama doesn't have enough fuel to reach class... | [{"type": "stdin_stdout", "input": "7\n3 10\n3 11\n5 11\n3 12\n3 13\n3 8\n3 8\n3 32", "output": "Yes\nNo\nYes\nNo\nNo\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "7\n3 10\n3 11\n5 11\n3 12\n3 13\n3 8\n3 11\n4 32", "output": "Yes\nNo\nYes\nNo\nNo\nYes\nNo\n"}, {"type": "stdin_stdout", "input": "7\n1 0\n3 12\n1 10\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWalter and Jesse's friend Mike had helped them in making Crymeth and hence, they wanted to give him a share.\nFor deciding the share, they both decided to choose one number each, X and Y and found out that K^th Highest Co... | [{"type": "stdin_stdout", "input": "97\n1313416998 993571903 6\n5158133151 8524785232 7\n1750815523 8199560165 9\n3427555468 1298742223 3\n1767424737 8349144254 3\n7255619299 6606660467 7\n5786862276 2636132251 2\n10865125029 3088810998 6\n7839400579 9956455418 3\n6302924883 792549880 4\n1012933025 5679789796 8\n207983... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.\n\nGiven an integer N, determine whether N can be represented as the product of two integers between 1 and... | [{"type": "stdin_stdout", "input": "00010", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "00001", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "11111", "output": "No\n"}, {"type": "stdin_stdout", "input": "10111", "output": "No\n"}, {"type": "stdin_stdout", "input": "10011", "output": "No\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string S of length 2N consisting of lowercase English letters.\n\nThere are 2^{2N} ways to color each character in S red or blue. Among these ways, how many satisfy the following condition?\n\n* The string... | [{"type": "stdin_stdout", "input": "18\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "output": "9075135300"}, {"type": "stdin_stdout", "input": "18\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`aaaa", "output": "0\n"}, {"type": "stdin_stdout", "input": "18\naaaaaaaaaaaaaaaaaaaaaaabaaaaaaa`aaaa", "output": "0\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number.\n\nConstraints\n\n* 1 β€ a,b β€ 100\n* a and b are integers.\n\nInput\n\nInput is ... | [{"type": "stdin_stdout", "input": "000 001", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "010 000", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "000 000", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "000 100", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "110 100", "output": "No\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou've come to your favorite store Infinitesco to buy some ice tea.\n\nThe store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H ... | [{"type": "stdin_stdout", "input": "12345678 87654321 12345678 87654321\n226515686", "output": "2796489721305108\n"}, {"type": "stdin_stdout", "input": "12345678 87654321 12873114 87654321\n226515686", "output": "2915962248666204\n"}, {"type": "stdin_stdout", "input": "12345678 87654321 12345678 87654321\n123456789", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer N.\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of ... | [{"type": "stdin_stdout", "input": "53937807463", "output": "10\n"}, {"type": "stdin_stdout", "input": "10211397040", "output": "6\n"}, {"type": "stdin_stdout", "input": "16034112351", "output": "8\n"}, {"type": "stdin_stdout", "input": "18677078008", "output": "6\n"}, {"type": "stdin_stdout", "input": "15102704751", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is p... | [{"type": "stdin_stdout", "input": "18 1 -1\n2 -1 1\n5 2 1\n1 1 4\n5 2 0\n2 0 12", "output": "18\n"}, {"type": "stdin_stdout", "input": "10 10 5\n1 14 1\n4 1 1\n6 4 4\n9 0 2\n3 2 4", "output": "10\n"}, {"type": "stdin_stdout", "input": "10 10 0\n1 6 1\n4 1 1\n6 4 4\n9 4 0\n3 2 4", "output": "100\n"}, {"type": "stdin_st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is Kannon-do in the mountain behind Ichiro's house. There are 30 steps from the foot to this Kannon-do, and Ichiro goes to Kannon-do almost every day. Ichiro can go up the stairs up to 3 steps with one foot. While p... | [{"type": "stdin_stdout", "input": "1\n1\n30\n27\n0", "output": "1\n1\n14740\n2369\n"}, {"type": "stdin_stdout", "input": "1\n17\n28\n27\n0", "output": "1\n6\n4357\n2369\n"}, {"type": "stdin_stdout", "input": "1\n1\n30\n25\n0", "output": "1\n1\n14740\n701\n"}, {"type": "stdin_stdout", "input": "1\n17\n28\n24\n0", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAiz, which is located in cyberspace, trades information with Wakamatsu. The two countries are developing their economies by exchanging useful data with each other. The two countries, whose national policy is philanthropy ... | [{"type": "stdin_stdout", "input": "5\n18\n102\n-155\n53\n32", "output": "3"}, {"type": "stdin_stdout", "input": "5\n18\n102\n-181\n53\n9", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n18\n102\n-155\n53\n9", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n18\n146\n-181\n53\n9", "output": "0\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTaro decided to go to the summer festival held at JOI Shrine.\n\nN night shops are open along the way to JOI Shrine. Each night shop is numbered from 1 to N in order, and the fun of playing and the time it takes to play a... | [{"type": "stdin_stdout", "input": "5 20 14\n7 18\n2 4\n7 13\n1 3\n0 12", "output": "8\n"}, {"type": "stdin_stdout", "input": "8 4 38\n7 13\n6 0\n11 27\n1 3\n0 15", "output": "7\n"}, {"type": "stdin_stdout", "input": "5 20 14\n8 9\n2 4\n7 13\n1 3\n5 8", "output": "11\n"}, {"type": "stdin_stdout", "input": "5 20 14\n7 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour mission in this problem is to write a computer program that manipulates molecular for- mulae in virtual chemistry. As in real chemistry, each molecular formula represents a molecule consisting of one or more atoms. H... | [{"type": "stdin_stdout", "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"}, {"type": "stdin_stdout", "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)... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nICPC Calculator\n\nIn mathematics, we usually specify the order of operations by using parentheses. For example, 7 Γ (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 Γ ... | [{"type": "stdin_stdout", "input": "1\n4\n0\n+\n2.115262384218664\n1.6946524456220797\n1.2494077125386351\n0\n+\n2.4871472060127386\n+.\n.-*\n3...\n...)\n--.+1\n2....\n1.1146316365084887\n-1\n*\n0\n1.4326064398520582\n.3.\n)/\n0.6657411913142146\n*/.\n.7..\n...6\n1.7891160931823404\n-1", "output": "4\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe full exploration sister is a very talented woman. Your sister can easily count the number of routes in a grid pattern if it is in the thousands. You and your exploration sister are now in a room lined with hexagonal t... | [{"type": "stdin_stdout", "input": "-2 1 -1 2\n6\n-1 2\n2 0\n1 -2\n1 1\n-1 -1\n-1 -1\n2 5", "output": "-1\n"}, {"type": "stdin_stdout", "input": "-2 1 -1 2\n6\n-1 2\n2 0\n1 -2\n1 1\n-1 -1\n-1 -1\n3 5", "output": "-1\n"}, {"type": "stdin_stdout", "input": "-2 0 -1 2\n6\n-1 2\n2 0\n1 -2\n1 1\n-1 -1\n-1 -1\n3 5", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJAG-channel\n\nNathan O. Davis operates an electronic bulletin board called JAG-channel. He is currently working on adding a new feature called Thread View.\n\nLike many other electronic bulletin boards, JAG-channel is th... | [{"type": "stdin_stdout", "input": "6\nhoge\n.fuga\n..foobar\n..jagjag\n...zigzag\n.piyo\n8\njagjag\n.hogehoge\n..fugafuga\n...ponyoponyo\n....evaeva\n....pokemon\n...nowawa\n.buhihi\n8\nhello\n.goodmorning\n..howareyou\n.goodafternoon\n..letshavealunch\n.goodevening\n.goodnight\n..gotobed\n3\ncaution\n.themessagelengt... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA-Aun's breathing\n\nProblem Statement\n\nMaeda-san and Goto-san, who will both turn 70 years old in 2060, are long-time friends and friends who fought together at the ACM-ICPC in college.\n\nThe two are still excited abo... | [{"type": "stdin_stdout", "input": "4\nA\nUn\nA\nUn", "output": "YES"}, {"type": "stdin_stdout", "input": "4\nA\nUn\nB\nUn", "output": "NO\n"}, {"type": "stdin_stdout", "input": "4\n@\nUn\nB\nUn", "output": "NO\n"}, {"type": "stdin_stdout", "input": "4\n@\nUn\nB\nnU", "output": "NO\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nAOR Ika made a set $ S = \\\\ {a_1, ..., a_N \\\\} $ and a map $ f: S β S $. $ f (a_i) = b_i $. For any element $ x $ in the set $ S $, all maps $ g, h: S β S $ satisfying $ g (f (x)) = h (f (x)) $ are $ g (x).... | [{"type": "stdin_stdout", "input": "5\n2 1 3 4 5\n3 4 2 5 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "5\n1 2 3 4 5\n2 4 3 5 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "5\n1 3 2 4 5\n3 4 2 5 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "5\n2 1 3 4 5\n2 4 3 5 1", "output": "Yes\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe chef is preparing a birthday cake for one of his guests,\nand his decided to write the age of the guest in candles on the cake.\nThere are 10 types of candles, one for each of the digits '0' through '9'.\nThe chef has... | [{"type": "stdin_stdout", "input": "3\n2 1 1 8 1 6 3 1 2 1\n0 1 1 1 1 1 1 1 1 1\n2 2 1 3 1 1 2 1 1 1", "output": "11\n10\n22\n"}, {"type": "stdin_stdout", "input": "3\n2 1 1 4 1 6 3 2 2 2\n0 1 1 2 2 1 1 1 1 1\n2 1 1 2 1 1 3 1 1 1", "output": "11\n10\n11\n"}, {"type": "stdin_stdout", "input": "3\n2 1 1 4 0 6 3 2 2 2\n0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nChef has learned a new technique for comparing two recipes. A recipe contains a list of ingredients in increasing order of the times they will be processed. An ingredient is represented by a letter 'a'-'z'. The i-th lette... | [{"type": "stdin_stdout", "input": "3\nelax axle\nesidarap djapers\nalice bob", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3\nelax ayle\nesidarap djapers\nalice bob", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3\nelax ayle\nesidarap srepajd\nalice bob", "output": "YES\nYES\nY... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. Th... | [{"type": "stdin_stdout", "input": "100 3\n.*.\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n**... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Metropolis computer network consists of n servers, each has an encryption key in the range from 0 to 2^k - 1 assigned to it. Let c_i be the encryption key assigned to the i-th server. Additionally, m pairs of servers ... | [{"type": "stdin_stdout", "input": "10 40 10\n838 215 738 782 183 422 127 283 103 129\n1 2\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n1 10\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n2 10\n3 3\n3 5\n3 6\n3 7\n3 8\n3 9\n3 10\n4 5\n4 6\n4 7\n4 9\n4 10\n5 7\n5 8\n5 9\n5 10\n6 7\n6 8\n6 9\n6 10\n7 9\n7 10\n8 10\n9 10\n", "output": "1028608\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a matrix a, consisting of n rows and m columns. Each cell contains an integer in it.\n\nYou can change the order of rows arbitrarily (including leaving the initial order), but you can't change the order of c... | [{"type": "stdin_stdout", "input": "5 5\n1337 1466 1337 1337 1337\n1337 1337 1337 1337 1337\n1337 1337 1337 1337 1337\n1337 1337 1337 1337 1337\n1337 1337 1337 1337 1337\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "5 5\n1337 1337 1337 1337 1337\n1337 1337 1337 1337 1337\n1337 1337 1337 1337 1337\n1337 1337 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nStudent Dima from Kremland has a matrix a of size n Γ m filled with non-negative integers.\n\nHe wants to select exactly one integer from each row of the matrix so that the bitwise exclusive OR of the selected integers is... | [{"type": "stdin_stdout", "input": "1 249\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 0 0 0 0 0 -1 0 0 0 0 0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNauuo is a girl who loves writing comments.\n\nOne day, she posted a comment on Codeforces, wondering whether she would get upvotes or downvotes.\n\nIt's known that there were x persons who would upvote, y persons who wou... | [{"type": "stdin_stdout", "input": "000 100 100\n", "output": "?\n"}, {"type": "stdin_stdout", "input": "100 100 100\n", "output": "?"}, {"type": "stdin_stdout", "input": "101 0 100\n", "output": "+\n"}, {"type": "stdin_stdout", "input": "25 24 100\n", "output": "?\n"}, {"type": "stdin_stdout", "input": "123 29 43\n", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n points on the plane, the i-th of which is at (x_i, y_i). Tokitsukaze wants to draw a strange rectangular area and pick all the points in the area.\n\nThe strange area is enclosed by three lines, x = l, y = a a... | [{"type": "stdin_stdout", "input": "35\n8 1\n6 8\n4 1\n1 2\n1 4\n5 10\n10 8\n9 1\n9 9\n10 2\n6 5\n16 8\n7 6\n10 6\n9 4\n4 9\n3 2\n1 8\n3 9\n7 3\n3 4\n2 7\n3 8\n3 1\n2 2\n5 5\n7 2\n4 10\n6 3\n5 1\n8 10\n4 3\n9 8\n9 7\n3 10\n", "output": "390\n"}, {"type": "stdin_stdout", "input": "35\n8 1\n6 8\n4 1\n1 2\n1 4\n5 10\n10 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is an easier version of the next problem. In this version, q = 0.\n\nA sequence of integers is called nice if its elements are arranged in blocks like in [3, 3, 3, 4, 1, 1]. Formally, if two elements are equal, every... | [{"type": "stdin_stdout", "input": "100 0\n6 7 100 8 5 61 5 75 59 65 51 47 83 37 34 54 87 46 4 26 21 87 12 97 86 68 60 11 62 76 14 83 29 31 91 62 57 80 47 75 85 97 62 77 91 86 14 25 48 77 83 65 39 61 78 77 45 46 90 74 100 91 86 98 55 5 84 42 91 69 100 4 74 98 11 37 75 44 41 12 15 34 36 1 99 16 7 87 36 26 79 42 41 84 17... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPetya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.\n\... | [{"type": "stdin_stdout", "input": "1000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "477\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "124\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "480\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "141\n", "output": "YES\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given n integers a_1, a_2, ..., a_n, such that for each 1β€ i β€ n holds i-nβ€ a_iβ€ i-1.\n\nFind some nonempty subset of these integers, whose sum is equal to 0. It can be shown that such a subset exists under given ... | [{"type": "stdin_stdout", "input": "1\n10\n-3 -3 -3 -3 -3 -3 -3 -2 7 7\n", "output": "7\n10 3 6 9 2 5 8\n"}, {"type": "stdin_stdout", "input": "1\n10\n-3 0 -6 1 0 -3 -2 -2 1 7\n", "output": "4\n3 9 8 10\n"}, {"type": "stdin_stdout", "input": "1\n10\n-1 -5 -3 -1 0 -3 -2 -2 7 7\n", "output": "3\n2 7 9\n"}, {"type": "stdi... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nXenia is a girl being born a noble. Due to the inflexibility and harshness of her family, Xenia has to find some ways to amuse herself.\n\n<image>\n\nRecently Xenia has bought n_r red gems, n_g green gems and n_b blue gem... | [{"type": "stdin_stdout", "input": "1\n10 10 10\n761 829 1037 1818 133 576 705 131 935 821\n896 163 569 957 169 475 342 1074 760 434\n131 383 243 247 908 799 56 1929 360 189\n", "output": "1928\n"}, {"type": "stdin_stdout", "input": "1\n10 10 10\n761 829 1037 1818 133 576 705 131 935 821\n896 163 569 656 169 475 342 10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLevian works as an accountant in a large company. Levian knows how much the company has earned in each of the n consecutive months β in the i-th month the company had income equal to a_i (positive income means profit, neg... | [{"type": "stdin_stdout", "input": "17\n-542470641 -617247806 1649173051 111521800 509758067 -860452587 447120886 234437807 707835273\n5\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "17\n-542470641 -617247806 998970243 699622219 732907519 -860452587 447120886 203125491 707835273\n5\n", "output": "17\n"}, {"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAcacius is studying strings theory. Today he came with the following problem.\n\nYou are given a string s of length n consisting of lowercase English letters and question marks. It is possible to replace question marks wi... | [{"type": "stdin_stdout", "input": "6\n7\nabacaba\n7\n???????\n11\naba?abaaabc\n11\nabacaba?aba\n15\nrewq???f???fdsa\n11\ncbaaabacaba\n", "output": "yes\nabacaba\nyes\nabacaba\nyes\nabacabaaabc\nyes\nabacabazaba\nno\nyes\ncbaaabacaba\n"}, {"type": "stdin_stdout", "input": "6\n7\nabacaba\n7\n???????\n11\naba?abaaabc\n11... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEasy and hard versions are actually different problems, so we advise you to read both statements carefully.\n\nYou are given a weighted rooted tree, vertex 1 is the root of this tree. Also, each edge has its own cost.\n\n... | [{"type": "stdin_stdout", "input": "4\n4 18\n2 1 9 2\n3 2 4 1\n4 1 1 2\n3 20\n2 1 8 1\n3 1 7 2\n5 50\n1 3 100 1\n1 5 10 2\n2 3 123 2\n5 4 55 1\n2 000\n1 2 409 2\n", "output": "0\n0\n11\n18\n"}, {"type": "stdin_stdout", "input": "4\n4 18\n2 1 18 2\n3 2 4 1\n4 1 2 2\n3 20\n2 1 2 1\n3 1 8 2\n5 50\n1 3 100 1\n1 5 10 2\n2 3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider a long corridor which can be divided into n square cells of size 1 Γ 1. These cells are numbered from 1 to n from left to right.\n\nThere are two people in this corridor, a hooligan and a security guard. Initiall... | [{"type": "stdin_stdout", "input": "3\n25 2 3 5\n2 7\n11 2 11 10\n1 1\n4 2 3 6\n4 4\n", "output": "1\n0\n1\n"}, {"type": "stdin_stdout", "input": "3\n11 2 3 20\n4 4\n7 2 3 -1\n5 1\n1 2 4 10\n0 1\n", "output": "2\n2\n2\n"}, {"type": "stdin_stdout", "input": "3\n13 2 3 1\n1 8\n7 2 1 6\n13 2\n7 2 3 12\n2 4\n", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour classmate, whom you do not like because he is boring, but whom you respect for his intellect, has two strings: s of length n and t of length m.\n\nA sequence p_1, p_2, β¦, p_m, where 1 β€ p_1 < p_2 < β¦ < p_m β€ n, is ca... | [{"type": "stdin_stdout", "input": "99 54\nfdabegacbffbgcacafcegfaegcacaegdbcabfgaecgbgfgefddggcdgebaaaccbcafdgcceabddfcacgdccfcgebccfffdaccac\nfdabegabffbgcaafcegfgcacaegdbcabfaecgbgfcgbccfffdaccac\n", "output": "40\n"}, {"type": "stdin_stdout", "input": "94 51\ndfccgcagbebffedfgbccfgddcffdecegcgebgbaebadcgagagdceffcd... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTo satisfy his love of matching socks, Phoenix has brought his n socks (n is even) to the sock store. Each of his socks has a color c_i and is either a left sock or right sock. \n\nPhoenix can pay one dollar to the sock s... | [{"type": "stdin_stdout", "input": "4\n6 3 3\n1 2 3 2 2 2\n6 2 4\n1 1 2 2 2 2\n6 5 1\n6 5 4 3 2 1\n4 0 4\n4 4 4 3\n", "output": "\n2\n3\n5\n3\n"}, {"type": "stdin_stdout", "input": "4\n6 3 3\n1 2 6 2 2 2\n6 2 4\n1 1 2 2 2 2\n6 5 1\n6 5 4 3 2 1\n4 0 4\n4 4 4 3\n", "output": "2\n3\n5\n3\n"}, {"type": "stdin_stdout", "inp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet f(i) denote the minimum positive integer x such that x is not a divisor of i.\n\nCompute β_{i=1}^n f(i) modulo 10^9+7. In other words, compute f(1)+f(2)+...+f(n) modulo 10^9+7.\n\nInput\n\nThe first line contains a si... | [{"type": "stdin_stdout", "input": "6\n1\n4\n3\n4\n10\n10000000000000000\n", "output": "2\n10\n7\n10\n26\n366580019\n"}, {"type": "stdin_stdout", "input": "6\n1\n2\n3\n4\n10\n10000000000000000\n", "output": "2\n5\n7\n10\n26\n366580019\n"}, {"type": "stdin_stdout", "input": "1\n5897090464090076\n", "output": "428992762\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nReca company makes monitors, the most popular of their models is AB999 with the screen size a Γ b centimeters. Because of some production peculiarities a screen parameters are integer numbers. Recently the screen sides ra... | [{"type": "stdin_stdout", "input": "2000000000 2000000000 1999999998 1999999999\n", "output": "1999999998 1999999999"}, {"type": "stdin_stdout", "input": "2000000000 2000000000 1999999999 1999999998\n", "output": "1999999999 1999999998"}, {"type": "stdin_stdout", "input": "1688112099 1875662241 198852947 116042960\n", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFurik loves math lessons very much, so he doesn't attend them, unlike Rubik. But now Furik wants to get a good mark for math. For that Ms. Ivanova, his math teacher, gave him a new task. Furik solved the task immediately.... | [{"type": "stdin_stdout", "input": "1000 1010\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1000 1000\n", "output": "0"}, {"type": "stdin_stdout", "input": "1190 225\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1190 315\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1491 512\n", "output... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMaxim has opened his own restaurant! The restaurant has got a huge table, the table's length is p meters.\n\nMaxim has got a dinner party tonight, n guests will come to him. Let's index the guests of Maxim's restaurant fr... | [{"type": "stdin_stdout", "input": "50\n15 28 34 29 17 21 20 34 37 17 10 20 37 10 18 25 31 25 16 1 37 27 39 3 5 18 2 32 10 35 20 17 29 20 3 29 3 25 9 32 37 5 25 23 25 33 35 8 31 29\n39\n", "output": "1.499798753"}, {"type": "stdin_stdout", "input": "50\n15 28 34 29 17 21 20 34 37 17 10 20 37 10 18 25 31 25 16 1 37 27 3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal s... | [{"type": "stdin_stdout", "input": "1000000 1000000\n1000000 999999\n1000000 999998\n999999 1000000\n999999 999998\n999998 1000000\n999998 999999\n999998 999998\n", "output": "respectable"}, {"type": "stdin_stdout", "input": "581646 464672\n493402 649074\n581646 649074\n214619 649074\n581646 252709\n214619 252709\n2146... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSereja loves number sequences very much. That's why he decided to make himself a new one following a certain algorithm.\n\nSereja takes a blank piece of paper. Then he starts writing out the sequence in m stages. Each tim... | [{"type": "stdin_stdout", "input": "7\n1 53989\n1 47249\n1 71935\n2 1 3\n1 84520\n1 84185\n2 6 1\n14\n1 2 3 4 5 6 7 8 9 10 11 12 13 14\n", "output": "53989 47249 71935 53989 53989 53989 84520 84185 53989 47249 71935 53989 53989 53989 "}, {"type": "stdin_stdout", "input": "7\n1 53989\n1 47249\n1 71935\n2 1 3\n1 84520\n1... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.