Sphere Online Judge

Computer geeks! Show off your skills and claim the job of your dreams! RecruitCoders.com

SPOJ Problem Set (challenge)

8672. Distributing the balls

Problem code: BALLS

In this task you have compute the number of ways we can distribute A balls into B cells with with every cell having at-least one ball. 

Input

The inputs A and B are given in a single line separated by a blank,the inputs are terminated by EOF.

Output

Output the answer modulus 247383691.

 

Score

Score is the length of your code.

Example

Input:
12 4
6 3

Output:

14676024
540

Constraints
  • Every A and B can be distinguishable.
  • [math]0 \le A \le 1000000 [\math]
  • [math]0 \le B \le 100 [\math]

Added by:.:: Debanjan ::.
Date:2011-03-28
Time limit:0.5s-10s
Source limit:1000B
Languages:All
Resource:Own problem

hide comments
2011-06-12 02:27:05 hallvabo
@HWK: suddenly my solution worked! It still matches yours for all the example inputs you provided.

Finally made it! The last few bytes were hard to cut.

Last edit: 2011-06-12 03:57:53
2011-06-12 00:49:50 HWK
@.:: Debanjan ::.: Could you please say me where my solution 5231091 fails?

Edit: I found my mistake. E.g. 3 3 fails.

Last edit: 2011-06-12 11:05:55
SPOJ System © 2012 Sphere Research Labs | Projekty informatyczne i aplikacje na zamówienie. All Rights Reserved.