我是個對電腦科學有興趣的學生,我會貼上我的學習歷程及生活心情,也請大大們多多指教。 :)

2013年3月23日 星期六

[UVa]10219 - Find the ways !


 Find the ways !

The Problem


An American, a Frenchman and an Englishwoman had been to Dhaka, the capital of Bangladesh. They went sight-seeing in a taxi. The three tourists were talking about the sites in the city. The American was very proud of tall buildings in New York. He boasted to his friends, "Do you know that the Empire State Building was built in three months?"
"Really?" replied the Frenchman. "The Eiffel Tower in Paris was built in only one month! (However, The truth is, the construction of the Tower began in January 1887. Forty Engineers and designers under Eiffel's direction worked for two years. The tower was completed in March 1889.)
"How interesting!" said the Englishwoman. "Buckingham Palace in London was built in only two weeks!!"
At that moment the taxi passed a big slum ( However, in Bangladesh we call it "Bostii"). "What was that? When it was built ?" The Englishwomen asked the driver who was a Bangladeshi.
"I don't know!" , answered the driver. "It wasn't there yesterday!"
However in Bangladesh, illegal establishment of slums is a big time problem. Government is trying to destroy these slums and remove the peoples living there to a far place, formally in a planned village outside the city. But they can't find any ways, how to destroy all these slums!
Now, can you imagine yourself as a slum destroyer? In how many ways you can destroy k
slums out of n slums ! Suppose there are 10 slums and you are given the permission of destroying 5 slums, surly you can do it in 252 ways, which is only a 3 digit number, Your task is to find out the digits in ways you can destroy the slums !




The Input


The input file will contain one or more test cases.
Each test case consists of one line containing two integers n (n>=1) and k (1<=<k=<n).

The Output


For each test case, print one line containing the required number. This number will always fit into an integer, i.e. it will be less than 2^31-1.

Sample Input


20 5
100 10
200 15

Sample Output


5
14
23
------------------------------------------------------------------------------------------------------------

大家好

  大家好,我現在是中山大學資工系的學生,這個 blog 是想用來記錄我的心情、學習歷程、UVa解題還有我的生活點滴,對於電腦科學系頗有興趣,我是個正在學習的學生,所以若有哪些知識不足的地方,請各位大大多多指教。