Your company provides robots that can be used to pick up litter from fields after sporting events and concerts. Before robots are assigned to a job, an aerial photograph of the field is marked with a grid. Each location in the grid that contains
Problem DescriptionMaybe you know “San Guo Sha”, but I guess you didn’t hear the game: “Liang Guo Sha”!Let me introduce this game to you. Unlike “San Guo Sha” with its complicated rules, “Liang Guo Sha&
The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are summed and the
Problem B: Tight wordsGiven is an alphabet {0, 1, ... , k}, 0 <= k <= 9 .We say that a word of length n over this alphabet istight if any two neighbour digits in the word do not differby more than 1.Input is a sequence of lines, each line
Problem HArrange Some MarblesInput: Standard InputOutput: Standard Outputyou are given some marbles of n different color. You have to arrange these marbles in a line. The marbles adjacent with same color form a group. In each group there can be 1 to
I often buy Coca-Cola from the vending machine at work. Usually I buy several cokes at once, since my working mates also likes coke. A coke in the vending machine costs 8 Swedish crowns, and the machine accept crowns with the values 1, 5 and 10. As
Fast FoodThe fastfood chain McBurger owns several restaurants along a highway. Recently, they have decided to build several depots along the highway, each one located at a restaurent and supplying several of the restaurants with the needed
Problem A: How do you add?Larry is very bad at math - he usually uses a calculator, which worked well throughout college. Unforunately, he is now struck in a deserted island with his good buddy Ryan after a snowboarding accident. They're now trying
The Tower of Babylon Perhaps you have heard of the legend of the Tower of Babylon. Nowadays many details of this tale have been forgotten. So now, in line with the educational nature of this contest, we will tell you the whole story:The
In ancient days there was a country whose people had very interesting habits. Some of them were lazy, some were very rich, some were very poor and some were miser. Obviously, some of the rich were miser (A poor was never miser as he had little to
Wavio is a sequence of integers. It has some interesting properties.· Wavio is of odd length i.e. L = 2*n + 1.· The first (n+1) integers of Wavio sequence makes a strictly increasing sequence.· The last (n+1)
As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over the world ^v^). But here comes a problem, there is
In an n x n chessboard, Prince and Princess plays a game. The squares in the chessboard are numbered 1, 2, 3 ... n*n, as shown below:Prince stands in square 1, make p jumps and finally reach square n*n. He enters a square at most once. So if we use
string by combining two subsequences from the first two strings.After deleting 0 or more characters from a string we can get its subsequence. For example “a”, “b”, “c”, “ab”, “ac”,
THE SAMS' CONTEST Problem 0!! REALLY STRANGE !!BACKGROUNDRaju has recently passed BSc. Engineering in Computer Science & Engineering from BUET ( Bangladesh University of Extraordinary Talents), the best university of Bangladesh. After
JugsIn the movie ``Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted with the following puzzle. They were given a 3-gallon jug and a 5-gallon jug and were asked to fill the 5-gallon jug with exactly 4 gallons. This problem
Problem EAntimatter Ray ClearcuttingInput: Standard InputOutput: Standard OutputIt's year 2465, and you are the Chief Engineer for Glorified Lumberjacks Inc. on planet Trie. There is a number of trees that you need to cut down, and the only weapon