Bangla numbers ====== ======= Bangla numbers normally use 'kuti' (10000000), 'lakh' (100000), 'hajar' (1000), 'shata' (100) while expanding and converting to text. You are going to write a program to convert a given number to text with them. Input ----- The input file may contain several test cases. Each case will contain a non-negative number <= 999999999999999. Output ------ For each case of input, you have to output a line starting with the case number with four digits adjustment followed by the converted text. Sample Input ------ ----- 23764 45897458973958 Sample Output ------ ------ 1. 23 hajar 7 shata 64 2. 45 lakh 89 hajar 7 shata 45 kuti 89 lakh 73 hajar 9 shata 58http://acm.uva.es/p/v101/10101.html
Suppose that there are 101 players entered in a "single elimination" tennis tournament. In such a tournament any player who loses a match, must drop out, and every match ends in a victory for some player - there are no ties. In each round of the tournament, the players remaining are matched into as many pairs as possible, but if there is an odd number of players left, someone receives a bye (which means an automatic vitory for this player in this round) Enough rounds are played until a single player remains who wins the tournament. The problem is : How many matches are played in total?
The "parity" of a number refers to whether it contains an odd or even number of 1-bits. The number has "odd parity", if it contains odd number of 1-bits and is "even parity", if it contains even number of 1-bits. Write a C program to find the parity of an unsigned integer.
Calculate: B^P mod M for large values of B, P and M using a very efficient algorithm. Value ranges: B 0-2147483647 P 0-2147483647 M 1-46340