The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has one...
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them...
It is not easy to prepare a problem for a programming contest. Petya and Vasya decided that problem “A+B” needs at least n distinct solutions to be written. It ...