Page 1 of 4

10925 - Krakovia

Posted: Sat Oct 01, 2005 6:11 pm
by SRX
Can you give me some testdata , I don't know where wrong in my code

thanks

tricky case

Posted: Sun Oct 02, 2005 3:28 am
by wook
stupid mistake.

ignore it. :oops:

sorry

Posted: Sun Oct 02, 2005 5:08 am
by wook
i got very stupid mistake.. :oops:

sorry again.



V < 10^20,
thus we can't use only 64bit integers.

and, the test cases I used to debug my program

input:
1 1
1

1 20
1

3 9
1
4
3

3 8
1
4
3

1 1
31415926535897932384

5 11
99999999999999999999
99999999999999999999
99999999999999999999
99999999999999999999
99999999999999999999

2 20
31415926535897932384
31415926535897932384

2 9
20000000000
1000

3 1
100000000000000000000
200000000000000000000
400000000000000000000

11 2
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000

5 20
100000000000000000000
99999999999999999999
99999999999999999998
99999999999999999997
99999999999999999996

4 17
3515135187212
503540533457899
2132105
102

21 7
1
10
100
1000
10000
100000
1000000
10000000
100000000
1000000000
10000000000
100000000000
1000000000000
10000000000000
100000000000000
1000000000000000
10000000000000000
100000000000000000
1000000000000000000
10000000000000000000
100000000000000000000
0 0
output:
Bill #1 costs 1: each friend should pay 1

Bill #2 costs 1: each friend should pay 0

Bill #3 costs 8: each friend should pay 0

Bill #4 costs 8: each friend should pay 1

Bill #5 costs 31415926535897932384: each friend should pay 31415926535897932384

Bill #6 costs 499999999999999999995: each friend should pay 45454545454545454545

Bill #7 costs 62831853071795864768: each friend should pay 3141592653589793238

Bill #8 costs 20000001000: each friend should pay 2222222333

Bill #9 costs 700000000000000000000: each friend should pay 700000000000000000000

Bill #10 costs 1100000000000000000000: each friend should pay 550000000000000000000

Bill #11 costs 499999999999999999990: each friend should pay 24999999999999999999

Bill #12 costs 507055670777318: each friend should pay 29826804163371

Bill #13 costs 111111111111111111111: each friend should pay 15873015873015873015

Re: sorry

Posted: Sun Oct 02, 2005 5:18 am
by SRX

Code: Select all

have AC 

try these..

Posted: Sun Oct 02, 2005 10:22 am
by sohel
try this case

Input

Code: Select all

2 3
9999
1
1 20
3
4 5
9999
999
99
9
0 0
Output

Code: Select all

Bill #1 costs 10000: each friend should pay 3333

Bill #2 costs 3: each friend should pay 0

Bill #3 costs 11106: each friend should pay 2221


Re: try these..

Posted: Sun Oct 02, 2005 12:20 pm
by SRX
sohel wrote:try this case

Input

Code: Select all

2 3
9999
1
1 20
3
4 5
9999
999
99
9
0 0
Output

Code: Select all

Bill #1 costs 10000: each friend should pay 3333

Bill #2 costs 3: each friend should pay 0

Bill #3 costs 11106: each friend should pay 2221

thanks very much

The reason is my "lazy bigint addition"
I don't code right addition , so got wa
I remember that I code lazy ( short code ) addition for speed :oops:

thanks sohel and wook again ! :D

Posted: Sat Oct 15, 2005 1:33 am
by Eva Tsai

Code: Select all



Posted: Sat Oct 15, 2005 3:05 am
by Timo
You can try this case :

1 1
56270
1 8
59532
11 4
46174
39274
57939
53253
62523
46232
49934
64389
60970
42991
46583
16 17
39008
59470
53737
39200
42326
40011
43117
53067
48817
47243
48956
50353
45630
62386
54306
62179
14 10
51959
49936
56012
41518
58226
60565
53840
46328
61011
50654
47690
48301
65452
43772
6 10
54850
55119
49470
48852
57800
60821
17 6
56305
54239
58889
54091
64035
51876
38340
65492
54206
63609
63493
58506
38590
55719
54342
60086
60088
5 5
44576
40948
40505
45189
52782
11 1
61926
52873
52155
49032
58536
62368
46146
47586
41034
41329
64354
12 11
48372
44217
58523
59537
59012
56261
49882
61864
48555
64678
39308
59656
0 0

Posted: Sat Oct 15, 2005 3:07 am
by Timo
Here is the output from my accepted program.

Bill #1 costs 56270: each friend should pay 56270

Bill #2 costs 59532: each friend should pay 7441

Bill #3 costs 570262: each friend should pay 142565

Bill #4 costs 789806: each friend should pay 46459

Bill #5 costs 735264: each friend should pay 73526

Bill #6 costs 326912: each friend should pay 32691

Bill #7 costs 951906: each friend should pay 158651

Bill #8 costs 224000: each friend should pay 44800

Bill #9 costs 577339: each friend should pay 577339

Bill #10 costs 649865: each friend should pay 59078


I hope you will get AC

Posted: Sat Oct 15, 2005 2:02 pm
by Eva Tsai
I've tried the cases posted by Timo,
and my WA program can print the same output, too.
Please give me more testdeta, thanks a lot.

Posted: Mon Oct 17, 2005 4:09 pm
by Eva Tsai
I've got AC.
What a stupid mistake I made!
Thanks for the response of Guest.

Posted: Tue Dec 27, 2005 6:27 am
by Jemerson
Hum.. i had accepted all sugestted inputs but I was still getting WA, so i found two inputs that showed me some extra cases. After correct this I got Accepted. Here they are:

Input:

Code: Select all

1 16
17432479801732498109834891047810
1 15
17432479801732498109834891047810
Output:

Code: Select all

Bill #1 costs 17432479801732498109834891047810: each friend should pay 1089529987608281131864680690488

Bill #2 costs 17432479801732498109834891047810: each friend should pay 1162165320115499873988992736520

Good Luck for everyone

10925 - Krakovia

Posted: Mon Apr 10, 2006 3:53 pm
by Roby
Somebody please help me, how to solve this problem? It's look like easy to solve but I failed with the second test case in sample input. Here's my code:

Code: Select all

AC already
Any help would be appreciated...

Posted: Thu Apr 13, 2006 3:34 am
by Roby
Anyone, help me please ... :cry:

Posted: Thu Apr 13, 2006 3:37 am
by Krzysztof Duleba
Isn't this problem about regular BigInt arithmetic operations? Just make sure they all work fine and you'll get AC.