id stringlengths 16 18 | content stringlengths 976 55.1k |
|---|---|
codescope_data_1 | There are n cities in Bearland, numbered 1 through n. Cities are arranged in one long row. The distance between cities i and j is equal to |iβ-βj|.Limak is a police officer. He lives in a city a. His job is to catch criminals. It's hard because he doesn't know in which cities criminals are. Though, he knows that there ... |
codescope_data_2 | Berland Football Cup starts really soon! Commentators from all over the world come to the event.Organizers have already built $$$n$$$ commentary boxes. $$$m$$$ regional delegations will come to the Cup. Every delegation should get the same number of the commentary boxes. If any box is left unoccupied then the delegatio... |
codescope_data_3 | IT City company developing computer games invented a new way to reward its employees. After a new game release users start buying it actively, and the company tracks the number of sales with precision to each transaction. Every time when the next number of sales is divisible by all numbers from 2 to 10 every developer ... |
codescope_data_4 | Luke Skywalker got locked up in a rubbish shredder between two presses. R2D2 is already working on his rescue, but Luke needs to stay alive as long as possible. For simplicity we will assume that everything happens on a straight line, the presses are initially at coordinates 0 and L, and they move towards each other wi... |
codescope_data_5 | The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" β the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, n can be rather big, and one cannot find the power using ... |
codescope_data_6 | You are given a bracket sequence $$$s$$$ (not necessarily a regular one). A bracket sequence is a string containing only characters '(' and ')'.A regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters '1' and '+' between the original character... |
codescope_data_7 | zscoder wants to generate an input file for some programming competition problem.His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he will manually generate the input in a text editor.Initially, the text editor is empty. It takes him x seconds to insert or delete a letter 'a' fro... |
codescope_data_8 | Petya 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.One day Petya was delivered a string s, containing only digits. He needs to find a string that represe... |
codescope_data_9 | Fox Ciel has a robot on a 2D plane. Initially it is located in (0, 0). Fox Ciel code a command to it. The command was represented by string s. Each character of s is one move operation. There are four move operations at all: 'U': go up, (x, y) βββ (x, y+1); 'D': go down, (x, y) βββ (x, y-1); 'L': go left, (x, y) βββ... |
codescope_data_10 | Dr. Evil kidnapped Mahmoud and Ehab in the evil land because of their performance in the Evil Olympiad in Informatics (EOI). He decided to give them some problems to let them go.Dr. Evil is interested in sets, He has a set of n integers. Dr. Evil calls a set of integers evil if the MEX of it is exactly x. the MEX of a ... |
codescope_data_11 | The princess is going to escape the dragon's cave, and she needs to plan it carefully.The princess runs at vp miles per hour, and the dragon flies at vd miles per hour. The dragon will discover the escape after t hours and will chase the princess immediately. Looks like there's no chance to success, but the princess no... |
codescope_data_12 | Little Dima misbehaved during a math lesson a lot and the nasty teacher Mr. Pickles gave him the following problem as a punishment. Find all integer solutions x (0β<βxβ<β109) of the equation:xβ=βbΒ·s(x)aβ+βc,β where a, b, c are some predetermined constant values and function s(x) determines the sum of all digits i... |
codescope_data_13 | Two players play a game. The game is played on a rectangular board with nβΓβm squares. At the beginning of the game two different squares of the board have two chips. The first player's goal is to shift the chips to the same square. The second player aims to stop the first one with a tube of superglue.We'll describe th... |
codescope_data_14 | Robbers, who attacked the Gerda's cab, are very successful in covering from the kingdom police. To make the goal of catching them even harder, they use their own watches.First, as they know that kingdom police is bad at math, robbers use the positional numeral system with base 7. Second, they divide one day in n hours,... |
codescope_data_15 | Misha and Vasya participated in a Codeforces contest. Unfortunately, each of them solved only one problem, though successfully submitted it at the first attempt. Misha solved the problem that costs a points and Vasya solved the problem that costs b points. Besides, Misha submitted the problem c minutes after the contes... |
codescope_data_16 | The tram in Berland goes along a straight line from the point 0 to the point s and back, passing 1 meter per t1 seconds in both directions. It means that the tram is always in the state of uniform rectilinear motion, instantly turning around at points xβ=β0 and xβ=βs.Igor is at the point x1. He should reach the point x... |
codescope_data_17 | One day Igor K. stopped programming and took up math. One late autumn evening he was sitting at a table reading a book and thinking about something. The following statement caught his attention: "Among any six people there are either three pairwise acquainted people or three pairwise unacquainted people"Igor just could... |
codescope_data_18 | One Sunday Petr went to a bookshop and bought a new book on sports programming. The book had exactly n pages.Petr decided to start reading it starting from the next day, that is, from Monday. Petr's got a very tight schedule and for each day of the week he knows how many pages he will be able to read on that day. Some ... |
codescope_data_19 | Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them away. Every m-th day (at days with numbers m,β2m,β3m,β...) mom buys a pair of socks to Vasya. She does it late in the eve... |
codescope_data_20 | Little Elephant loves magic squares very much.A magic square is a 3βΓβ3 table, each cell contains some positive integer. At that the sums of integers in all rows, columns and diagonals of the table are equal. The figure below shows the magic square, the sum of integers in all its rows, columns and diagonals equals 15. ... |
codescope_data_21 | "Contestant who earns a score equal to or greater than the k-th place finisher's score will advance to the next round, as long as the contestant earns a positive score..." β an excerpt from contest rules.A total of n participants took part in the contest (nββ₯βk), and you already know their scores. Calculate how many pa... |
codescope_data_22 | Vector Willman and Array Bolt are the two most famous athletes of Byteforces. They are going to compete in a race with a distance of L meters today. Willman and Bolt have exactly the same speed, so when they compete the result is always a tie. That is a problem for the organizers because they want a winner. While watc... |
codescope_data_23 | Famous Brazil city Rio de Janeiro holds a tennis tournament and Ostap Bender doesn't want to miss this event. There will be n players participating, and the tournament will follow knockout rules from the very first game. That means, that if someone loses a game he leaves the tournament immediately.Organizers are still ... |
codescope_data_24 | Once upon a time there were several little pigs and several wolves on a two-dimensional grid of size nβΓβm. Each cell in this grid was either empty, containing one little pig, or containing one wolf.A little pig and a wolf are adjacent if the cells that they are located at share a side. The little pigs are afraid of wo... |
codescope_data_25 | A group of university students wants to get to the top of a mountain to have a picnic there. For that they decided to use a cableway.A cableway is represented by some cablecars, hanged onto some cable stations by a cable. A cable is scrolled cyclically between the first and the last cable stations (the first of them is... |
codescope_data_26 | Katie, Kuro and Shiro are best friends. They have known each other since kindergarten. That's why they often share everything with each other and work together on some very hard problems.Today is Shiro's birthday. She really loves pizza so she wants to invite her friends to the pizza restaurant near her house to celebr... |
codescope_data_27 | One day a highly important task was commissioned to Vasya β writing a program in a night. The program consists of n lines of code. Vasya is already exhausted, so he works like that: first he writes v lines of code, drinks a cup of tea, then he writes as much as lines, drinks another cup of tea, then he writes lines a... |
codescope_data_28 | Vasiliy has a car and he wants to get from home to the post office. The distance which he needs to pass equals to d kilometers.Vasiliy's car is not new β it breaks after driven every k kilometers and Vasiliy needs t seconds to repair it. After repairing his car Vasiliy can drive again (but after k kilometers it will br... |
codescope_data_29 | A stowaway and a controller play the following game. The train is represented by n wagons which are numbered with positive integers from 1 to n from the head to the tail. The stowaway and the controller are initially in some two different wagons. Every minute the train can be in one of two conditions β moving or idle. ... |
codescope_data_30 | β This is not playing but duty as allies of justice, Nii-chan!β Not allies but justice itself, Onii-chan!With hands joined, go everywhere at a speed faster than our thoughts! This time, the Fire SistersΒ β Karen and TsukihiΒ β is heading for somewhere they've never reachedΒ β water-surrounded islands!There are three clust... |
codescope_data_31 | Two chess pieces, a rook and a knight, stand on a standard chessboard 8βΓβ8 in size. The positions in which they are situated are known. It is guaranteed that none of them beats the other one.Your task is to find the number of ways to place another knight on the board so that none of the three pieces on the board beat ... |
codescope_data_32 | You are given three integers k, pa and pb.You will construct a sequence with the following algorithm: Initially, start with the empty sequence. Each second, you do the following. With probability paβ/β(paβ+βpb), add 'a' to the end of the sequence. Otherwise (with probability pbβ/β(paβ+βpb)), add 'b' to the end of the s... |
codescope_data_33 | In Berland a money reform is being prepared. New coins are being introduced. After long economic calculations was decided that the most expensive coin should possess the denomination of exactly n Berland dollars. Also the following restriction has been introduced for comfort: the denomination of each coin should be div... |
codescope_data_34 | There are three friend living on the straight line Ox in Lineland. The first friend lives at the point x1, the second friend lives at the point x2, and the third friend lives at the point x3. They plan to celebrate the New Year together, so they need to meet at one point. What is the minimum total distance they have to... |
codescope_data_35 | Two bears are playing tic-tac-toe via mail. It's boring for them to play usual tic-tac-toe game, so they are a playing modified version of this game. Here are its rules.The game is played on the following field. Players are making moves by turns. At first move a player can put his chip in any cell of any small field. ... |
codescope_data_36 | You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a row, the system considers that the file content does not correspond to the socia... |
codescope_data_37 | One day Greg and his friends were walking in the forest. Overall there were n people walking, including Greg. Soon he found himself in front of a river. The guys immediately decided to get across the river. Luckily, there was a boat by the river bank, just where the guys were standing. We know that the boat can hold pe... |
codescope_data_38 | A little bear Limak plays a game. He has five cards. There is one number written on each card. Each number is a positive integer.Limak can discard (throw out) some cards. His goal is to minimize the sum of numbers written on remaining (not discarded) cards.He is allowed to at most once discard two or three cards with t... |
codescope_data_39 | The King of Flatland will organize a knights' tournament! The winner will get half the kingdom and the favor of the princess of legendary beauty and wisdom. The final test of the applicants' courage and strength will be a fencing tournament. The tournament is held by the following rules: the participants fight one on o... |
codescope_data_40 | One industrial factory is reforming working plan. The director suggested to set a mythical detail production norm. If at the beginning of the day there were x details in the factory storage, then by the end of the day the factory has to produce (remainder after dividing x by m) more details. Unfortunately, no customer... |
codescope_data_41 | Let's assume that we have a pair of numbers (a,βb). We can get a new pair (aβ+βb,βb) or (a,βaβ+βb) from the given pair in a single step.Let the initial pair of numbers be (1,1). Your task is to find number k, that is, the least number of steps needed to transform (1,1) into the pair where at least one number equals n.
... |
codescope_data_42 | You are given three positive integers x,βy,βn. Your task is to find the nearest fraction to fraction whose denominator is no more than n. Formally, you should find such pair of integers a,βb (1ββ€βbββ€βn;Β 0ββ€βa) that the value is as minimal as possible.If there are multiple "nearest" fractions, choose the one with the ... |
codescope_data_43 | Alexander is learning how to convert numbers from the decimal system to any other, however, he doesn't know English letters, so he writes any number only as a decimal number, it means that instead of the letter A he will write the number 10. Thus, by converting the number 475 from decimal to hexadecimal system, he gets... |
codescope_data_44 | A girl named Xenia has a cupboard that looks like an arc from ahead. The arc is made of a semicircle with radius r (the cupboard's top) and two walls of height h (the cupboard's sides). The cupboard's depth is r, that is, it looks like a rectangle with base r and height hβ+βr from the sides. The figure below shows what... |
codescope_data_45 | Buses run between the cities A and B, the first one is at 05:00 AM and the last one departs not later than at 11:59 PM. A bus from the city A departs every a minutes and arrives to the city B in a ta minutes, and a bus from the city B departs every b minutes and arrives to the city A in a tb minutes.The driver Simion w... |
codescope_data_46 | Galois is one of the strongest chess players of Byteforces. He has even invented a new variant of chess, which he named Β«PawnChessΒ».This new game is played on a board consisting of 8 rows and 8 columns. At the beginning of every game some black and white pawns are placed on the board. The number of black pawns placed i... |
codescope_data_47 | You may have heard of the pie rule before. It states that if two people wish to fairly share a slice of pie, one person should cut the slice in half, and the other person should choose who gets which slice. Alice and Bob have many slices of pie, and rather than cutting the slices in half, each individual slice will be ... |
codescope_data_48 | Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of this n days: whether that gym opened and whether a contest was carried out in the Internet on that day. For the i-th day there are four options: on this day the gym is closed and the ... |
codescope_data_49 | Pasha has a positive integer a without leading zeroes. Today he decided that the number is too small and he should make it larger. Unfortunately, the only operation Pasha can do is to swap two adjacent decimal digits of the integer.Help Pasha count the maximum number he can get if he has the time to make at most k swap... |
codescope_data_50 | Little penguin Polo loves his home village. The village has n houses, indexed by integers from 1 to n. Each house has a plaque containing an integer, the i-th house has a plaque containing integer pi (1ββ€βpiββ€βn).Little penguin Polo loves walking around this village. The walk looks like that. First he stands by a house... |
codescope_data_51 | On the Literature lesson Sergei noticed an awful injustice, it seems that some students are asked more often than others.Seating in the class looks like a rectangle, where n rows with m pupils in each. The teacher asks pupils in the following order: at first, she asks all pupils from the first row in the order of their... |
codescope_data_52 | You have n problems. You have estimated the difficulty of the i-th one as integer ci. Now you want to prepare a problemset for a contest, using some of the problems you've made.A problemset for the contest must consist of at least two problems. You think that the total difficulty of the problems of the contest must be ... |
codescope_data_53 | You have two positive integers w and h. Your task is to count the number of rhombi which have the following properties: Have positive area. With vertices at integer points. All vertices of the rhombi are located inside or on the border of the rectangle with vertices at points (0,β0), (w,β0), (w,βh), (0,βh). In othe... |
codescope_data_54 | A sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that required him to think a bit in order to enjoy candies the most. Would you succeed with the same task if you were on his place? One day, when he came to his friend Evan, Om Nom didn't find him at home but h... |
codescope_data_55 | Your friend recently gave you some slimes for your birthday. You have n slimes all initially with value 1.You are going to play a game with these slimes. Initially, you put a single slime by itself in a row. Then, you will add the other nβ-β1 slimes one by one. When you add a slime, you place it at the right of all alr... |
codescope_data_56 | On her way to programming school tiger Dasha faced her first test β a huge staircase! The steps were numbered from one to infinity. As we know, tigers are very fond of all striped things, it is possible that it has something to do with their color. So on some interval of her way she calculated two values β the number ... |
codescope_data_57 | Luke Skywalker gave Chewbacca an integer number x. Chewbacca isn't good at numbers but he loves inverting digits in them. Inverting digit t means replacing it with digit 9β-βt. Help Chewbacca to transform the initial number x to the minimum possible positive number by inverting some (possibly, zero) digits. The decimal... |
codescope_data_58 | Vanya has a scales for weighing loads and weights of masses w0,βw1,βw2,β...,βw100 grams where w is some integer not less than 2 (exactly one weight of each nominal value). Vanya wonders whether he can weight an item with mass m using the given weights, if the weights can be put on both pans of the scales. Formally spea... |
codescope_data_59 | Fangy collects cookies. Once he decided to take a box and put cookies into it in some way. If we take a square kβΓβk in size, divided into blocks 1βΓβ1 in size and paint there the main diagonal together with cells, which lie above it, then the painted area will be equal to the area occupied by one cookie k in size. Fan... |
codescope_data_60 | Devu wants to decorate his garden with flowers. He has purchased n boxes, where the i-th box contains fi flowers. All flowers in a single box are of the same color (hence they are indistinguishable). Also, no two boxes have flowers of the same color.Now Devu wants to select exactly s flowers from the boxes to decorate ... |
codescope_data_61 | Okabe needs bananas for one of his experiments for some strange reason. So he decides to go to the forest and cut banana trees.Consider the point (x,βy) in the 2D plane such that x and y are integers and 0ββ€βx,βy. There is a tree in such a point, and it has xβ+βy bananas. There are no trees nor bananas in other points.... |
codescope_data_62 | Mad scientist Mike is busy carrying out experiments in chemistry. Today he will attempt to join three atoms into one molecule.A molecule consists of atoms, with some pairs of atoms connected by atomic bonds. Each atom has a valence number β the number of bonds the atom must form with other atoms. An atom can form one o... |
codescope_data_63 | A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstrate fonts in printing or test the output devices.You are given a string consisting of lowercase and uppercase Latin letters. Check whether this ... |
codescope_data_64 | A tennis tournament with n participants is running. The participants are playing by an olympic system, so the winners move on and the losers drop out.The tournament takes place in the following way (below, m is the number of the participants of the current round): let k be the maximal power of the number 2 such that k... |
codescope_data_65 | You are given three sticks with positive integer lengths of a,βb, and c centimeters. You can increase length of some of them by some positive integer number of centimeters (different sticks can be increased by a different length), but in total by at most l centimeters. In particular, it is allowed not to increase the l... |
codescope_data_66 | There are well-known formulas: , , . Also mathematicians found similar formulas for higher degrees.Find the value of the sum modulo 109β+β7 (so you should find the remainder after dividing the answer by the value 109β+β7).
The only line contains two integers n,βk (1ββ€βnββ€β109,β0ββ€βkββ€β106).
Print the only integer a β ... |
codescope_data_67 | n children are standing in a circle and playing a game. Children's numbers in clockwise order form a permutation a1,βa2,β...,βan of length n. It is an integer sequence such that each integer from 1 to n appears exactly once in it.The game consists of m steps. On each step the current leader with index i counts out ai p... |
codescope_data_68 | What joy! Petya's parents went on a business trip for the whole year and the playful kid is left all by himself. Petya got absolutely happy. He jumped on the bed and threw pillows all day long, until... Today Petya opened the cupboard and found a scary note there. His parents had left him with duties: he should water t... |
codescope_data_69 | The finalists of the "Russian Code Cup" competition in 2214 will be the participants who win in one of the elimination rounds.The elimination rounds are divided into main and additional. Each of the main elimination rounds consists of c problems, the winners of the round are the first n people in the rating list. Each ... |
codescope_data_70 | Two little greedy bears have found two pieces of cheese in the forest of weight a and b grams, correspondingly. The bears are so greedy that they are ready to fight for the larger piece. That's where the fox comes in and starts the dialog: "Little bears, wait a little, I want to make your pieces equal" "Come off it fox... |
codescope_data_71 | IT City company developing computer games decided to upgrade its way to reward its employees. Now it looks the following way. After a new game release users start buying it actively, and the company tracks the number of sales with precision to each transaction. Every time when the next number of sales is not divisible ... |
codescope_data_72 | Last week, Hamed learned about a new type of equations in his math class called Modular Equations. Lets define i modulo j as the remainder of division of i by j and denote it by . A Modular Equation, as Hamed's teacher described, is an equation of the form in which a and b are two non-negative integers and x is a vari... |
codescope_data_73 | The Little Elephant loves numbers. He has a positive integer x. The Little Elephant wants to find the number of positive integers d, such that d is the divisor of x, and x and d have at least one common (the same) digit in their decimal representations. Help the Little Elephant to find the described number.
A single li... |
codescope_data_74 | You're given a string of lower-case Latin letters. Your task is to find the length of its longest substring that can be met in the string at least twice. These occurrences can overlap (see sample test 2).
The first input line contains the string. It's guaranteed, that the string is non-empty, consists of lower-case Lat... |
codescope_data_75 | You are locked in a room with a door that has a keypad with 10 keys corresponding to digits from 0 to 9. To escape from the room, you need to enter a correct code. You also have a sequence of digits.Some keys on the keypad have fingerprints. You believe the correct code is the longest not necessarily contiguous subsequ... |
codescope_data_76 | Hideo Kojima has just quit his job at Konami. Now he is going to find a new place to work. Despite being such a well-known person, he still needs a CV to apply for a job.During all his career Hideo has produced n games. Some of them were successful, some were not. Hideo wants to remove several of them (possibly zero) f... |
codescope_data_77 | A flea is sitting at one of the n hassocks, arranged in a circle, at the moment. After minute number k the flea jumps through kβ-β1 hassoΡks (clockwise). For example, after the first minute the flea jumps to the neighboring hassock. You should answer: will the flea visit all the hassocks or not. We assume that flea has... |
codescope_data_78 | You have r red, g green and b blue balloons. To decorate a single table for the banquet you need exactly three balloons. Three balloons attached to some table shouldn't have the same color. What maximum number t of tables can be decorated if we know number of balloons of each color?Your task is to write a program that ... |
codescope_data_79 | Polycarpus has a ribbon, its length is n. He wants to cut the ribbon in a way that fulfils the following two conditions: After the cutting each ribbon piece should have length a, b or c. After the cutting the number of ribbon pieces should be maximum. Help Polycarpus and find the number of ribbon pieces after the re... |
codescope_data_80 | Pasha has a wooden stick of some positive integer length n. He wants to perform exactly three cuts to get four parts of the stick. Each part must have some positive integer length and the sum of these lengths will obviously be n. Pasha likes rectangles but hates squares, so he wonders, how many ways are there to split ... |
codescope_data_81 | Ilya got tired of sports programming, left university and got a job in the subway. He was given the task to determine the escalator load factor. Let's assume that n people stand in the queue for the escalator. At each second one of the two following possibilities takes place: either the first person in the queue enters... |
codescope_data_82 | Little Petya loves counting. He wants to count the number of ways to paint a rectangular checkered board of size nβΓβm (n rows, m columns) in k colors. Besides, the coloring should have the following property: for any vertical line that passes along the grid lines and divides the board in two non-empty parts the number... |
codescope_data_83 | In some game by Playrix it takes t minutes for an oven to bake k carrot cakes, all cakes are ready at the same moment t minutes after they started baking. Arkady needs at least n cakes to complete a task, but he currently don't have any. However, he has infinitely many ingredients and one oven. Moreover, Arkady can bui... |
codescope_data_84 | One day Vasya was going home when he saw a box lying on the road. The box can be represented as a rectangular parallelepiped. Vasya needed no time to realize that the box is special, as all its edges are parallel to the coordinate axes, one of its vertices is at point (0,β0,β0), and the opposite one is at point (x1,βy1... |
codescope_data_85 | You are given a chessboard of size 1βΓβn. It is guaranteed that n is even. The chessboard is painted like this: "BWBW...BW".Some cells of the board are occupied by the chess pieces. Each cell contains no more than one chess piece. It is known that the total number of pieces equals to .In one step you can move one of th... |
codescope_data_86 | Bob likes to draw camels: with a single hump, two humps, three humps, etc. He draws a camel by connecting points on a coordinate plane. Now he's drawing camels with t humps, representing them as polylines in the plane. Each polyline consists of n vertices with coordinates (x1,βy1), (x2,βy2), ..., (xn,βyn). The first ve... |
codescope_data_87 | Fox Ciel has some flowers: r red flowers, g green flowers and b blue flowers. She wants to use these flowers to make several bouquets. There are 4 types of bouquets: To make a "red bouquet", it needs 3 red flowers. To make a "green bouquet", it needs 3 green flowers. To make a "blue bouquet", it needs 3 blue flowers... |
codescope_data_88 | "QAQ" is a word to denote an expression of crying. Imagine "Q" as eyes with tears and "A" as a mouth.Now Diamond has given Bort a string consisting of only uppercase English letters of length n. There is a great number of "QAQ" in the string (Diamond is so cute!). illustration by η«ε± https://twitter.com/nekoyaliu Bort ... |
codescope_data_89 | Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya calls a mask of a positive integer n the number that is obtained after successive writing of a... |
codescope_data_90 | Fox Ciel is playing a game with numbers now. Ciel has n positive integers: x1, x2, ..., xn. She can do the following operation as many times as needed: select two different indexes i and j such that xi > xj hold, and then apply assignment xi = xi - xj. The goal is to make the sum of all numbers as small as possible.... |
codescope_data_91 | Manao is trying to open a rather challenging lock. The lock has n buttons on it and to open it, you should press the buttons in a certain order to open the lock. When you push some button, it either stays pressed into the lock (that means that you've guessed correctly and pushed the button that goes next in the sequenc... |
codescope_data_92 | The whole world got obsessed with robots,and to keep pace with the progress, great Berland's programmer Draude decided to build his own robot. He was working hard at the robot. He taught it to walk the shortest path from one point to another, to record all its movements, but like in many Draude's programs, there was a ... |
codescope_data_93 | You are given a rectangular board of MβΓβN squares. Also you are given an unlimited number of standard domino pieces of 2βΓβ1 squares. You are allowed to rotate the pieces. You are asked to place as many dominoes as possible on the board so as to meet the following conditions:1. Each domino completely covers two square... |
codescope_data_94 | Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an nβΓβm chessboard, a very tasty candy and two numbers a and b.Dima put the chessboard in front of Inna and placed the candy in position (i,βj) on the board. The boy said he ... |
codescope_data_95 | Lengths are measures in Baden in inches and feet. To a length from centimeters it is enough to know that an inch equals three centimeters in Baden and one foot contains 12 inches.You are given a length equal to n centimeters. Your task is to convert it to feet and inches so that the number of feet was maximum. The resu... |
codescope_data_96 | Many students live in a dormitory. A dormitory is a whole new world of funny amusements and possibilities but it does have its drawbacks. There is only one shower and there are multiple students who wish to have a shower in the morning. That's why every morning there is a line of five people in front of the dormitory s... |
codescope_data_97 | One day Vasya heard a story: "In the city of High Bertown a bus number 62 left from the bus station. It had n grown-ups and m kids..."The latter events happen to be of no importance to us. Vasya is an accountant and he loves counting money. So he wondered what maximum and minimum sum of money these passengers could hav... |
codescope_data_98 | Just in case somebody missed it: this winter is totally cold in Nvodsk! It is so cold that one gets funny thoughts. For example, let's say there are strings with the length exactly n, based on the alphabet of size m. Any its substring with length equal to k is a palindrome. How many such strings exist? Your task is to ... |
codescope_data_99 | Ehab is interested in the bitwise-xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complete graph consisting of n vertices numbered from 0 to nβ-β1. For all 0ββ€βuβ<βvβ<βn, vertex u and vertex v are connected with an undirected edge that has weight (where is the bitwi... |
codescope_data_100 | Heidi the Cow is aghast: cracks in the northern Wall? Zombies gathering outside, forming groups, preparing their assault? This must not happen! Quickly, she fetches her HC2 (Handbook of Crazy Constructions) and looks for the right chapter:How to build a wall: Take a set of bricks. Select one of the possible wall desi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.