Emma’s Notebook

Problem Statement Emma is writing bits (1s and 0s) in her notebook. Every second, she writes more bits. In the 1st second, she writes two bits in her notebook. She starts with 0 and alternates between 0 and 1. They look like this: 0 1 In the 2nd second, she writes three more bits in…

Calendar Module

Problem Statement Calendar Module Calendar module allows you to output calendars and provides additional useful functions related to the calendar. class calendar.TextCalendar([firstweekday]) This class can be used to generate plain text calendars. Sample Code >>> import calendar >>> >>> print calendar.TextCalendar(firstweekday=6).formatyear(2015) 2015 January February March Su Mo Tu We Th Fr Sa Su Mo Tu…

Sherlock and Divisors

#codeifyoucansolve Watson gives an integer N to Sherlock and asks him: What is the number of divisors of N that are divisible by 2?. Input Format First line contains T, the number of testcases. This is followed by T lines each containing an integer N. Output Format For each testcase, print the required answer in…

Possible Path

Adam is standing at point (a,b) in an infinite 2D grid. He wants to know if he can reach point (x,y) or not. The only operation he can do is to move to point (a+b,b), (a,a+b), (a-b,b), or (a,a-b) from some point (a,b). It is given that he can move to any point on this…

Strange Grid

#codeifyoucansolve A strange grid has been recovered from an old book. It has 5 columns and infinite number of rows. The bottom row is considered as the first row. First few rows of the grid are like this: ………….. ………….. 20 22 24 26 28 11 13 15 17 19 10 12 14 16 18…

Name string

#codeifyoucansolve Name string is a string consisting of letters “R”,”K” and “V”. Today Oz wants to design a name string in a beautiful manner. Actually Oz cannot insert these three letters arbitrary anywhere ,he has to follow some rules to make the name string look beautiful. First thing is that the name string should consist…

Dipu and Interesting Numbers

#codeifyoucansolve Little Dipu is a small kid and like all the other kids, he likes to play, but he plays with numbers (He is extraordinary you know). Now-a-days Dipu has some extra interest in odd numbers. So, he says that a number N is interesting if it has odd number of divisors. Now Dipu turns…