Posts

December Circuits '18 || Hakerearth || Picking coins

Picking coins Alice and Bob are playing a game of picking coins.   They are given a large pile of  N  coins and an integer  k . In the  i t h  move of any player,  k i  coins are picked from the pile. A player who is not able to make the move during his turn loses. You are required to predict the winner of the game. Note : In every turn, Alice plays first followed by Bob. Input format First line:  T  that represents the total number of test cases Each line of the test case: Two space-separated integers  N  and  k    Output format For each test case, you are required to print the name of the winner of the game. You have to print either  Alice  or  Bob  depending upon who is the winner of the game. Constraints 1 ≤ T ≤ 100 1 ≤ N , k ≤ 10 18               SAMPLE...

code vita 2018 questiones

Image
1) Circles and Distances Problem Description Task is to calculate the straight line distance between the two objects moving in a circular path. They may move at different velocities. The distance has to be calculated after N seconds. The figure and commentary below it, explains the problem in detail. We have two point objects B and C at rest on a straight line at a distance r1 and r2 units from a point A. At time t=0 seconds, the objects start moving in a circular path with A at the center with velocity v1 and v2 degrees per second. Given inputs v1, v2, r1 and r2, calculate the distance between the B and C after N seconds. Distance should be printed up to an accuracy of 2 places after the decimal point. Use  Rounding Half-up  semantics. Input Format First line contains velocity of object B in degrees per second (v1) Second line contains distance of object B from A (r1) Third line contains velocity of object C in degrees per seco...