Você está na página 1de 4

CLOCK ANGLES

The angle between the hour and minute hands of an analog clock is always between 0 and 180 degrees, inclusive. For example, at 12:00 the angle between the hands is 0 degrees. In this problem you are to find the angle between the hands of a clock for an arbitary time 12:00 and 11:59. INPUT The input data will contain multiple test cases. Each test case will consist of 2 numbers. The first number specifies the hour, and will be greater than 0 and less than or equal to 12. The second number specifies the number of minutes and ill be in the range 0 to 59. two numbers, each of which is 0 , will follow the last test case. Output For each test case, display the time in the usual form and the smallest angle formed by hands, accurate to one fractional digit. The output should be similar to that shown in the sample below. Sample Input 12 0 12 30 60 30 Expected output At 12:00 the angle is 0.0 degrees. At 12:30 the angle is 165.0 degrees. At 6:00 the angle is 180.0 degrees At 3:00 the angle is 90.0 degrees.

PALLINDROME REVERSED!

A palindrome is a number that reads the same whether you read it from left to right or from right to left. Suppose we start with a number n. We reverse the digits of n and add it to n. If this number is a palindrome we stop. Otherwise, we repeat the reversal and addition and continue. For many numbers this process leads us to a palindrome! In this task you will be given a number n with at most 5 digits. Your task is to carry out the process described above and output the resulting palindrome, if you find one. You have to tell me the palindrome that you reach. For example if n is 149 then we get the following sequence: 149, 1090, 1991. Thus your program should output 1991 in this case. Input format A single line with a single integer n, with not more than 5 digits. Output format A single number : the palindrome generated by the process described above. Sample input 149 Expected output 1991 Sample input 194 Expected output 2992

COLOUR BOMBARD!

The RGB colour is a colour code where each colour (Red Green Blue) has a value from 0 to 255 , Given a question where we can target a given canvas and allow an area of effect to formed . Say the canvas is your Array and we will give the coordinates of bombarding ! Say your canvas is w w w w w w w w w w wwwwwwwwww wwwwwwwwww wwwwwwwwww wwwwwwwwww wwwwwwwwww wwwwwwwwww wwwwwwwwww wwwwwwwwww w w w w w w w w w w a 10x10 Canvas. WORKING RULE At the Given Coordinates mention the Dominant colours Value , and as we move away the colour should decrease by 50% , say the code was 254 for Red , the adjacent squares will have 254/2= 127(decimal part to be ignored) as the colour code, and so on till the value is below 10 then the colour is set to 0. Note Boundary Conditions Apply, The canvas is considered to be round and if the coordinates are on the edge then make sure the effect applies on the opposite part also ! INPUT The Input will be the X-Y Coordinates of the colour attack and the Colour code(in decimal) Output Output will be a canvas indicating the area of effect Sample Input 55 254 127 10

Expected output 15 15 15 15 15 15 15 15 15 0

15 15 15 15 15 15 15 15 0

31 31 31 31 31 31 31 15 0

31 63 63 63 63 63 31 15 0

31 31 31 63 63 63 127 127 127 127 254 127 127 127 127 63 63 63 31 31 31 15 15 15 0 0 0

31 63 63 63 63 63 31 15 0

31 31 31 31 31 31 31 15 0

15 15 15 15 15 15 15 15 0

0 0 0 0 0 0 0 0 0

Sample Input 11 60 10 10 Expected output 60 30 15 0 0 0 0 0 15 30 30 30 15 0 0 0 0 0 15 30 15 15 15 0 0 0 0 0 15 15 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 15 15 15 0 0 0 0 0 0 0 30 30 15 0 0 0 0 0 0 0