Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.
Problem hidden on 2010-11-09 10:50:28 by [Trichromatic] XilinX

MDIGIT3 - Digits Count

 

 

English Vietnamese

 

Albert, Charles and Mary invented a new version of the classical game Bingo. In traditional
Bingo the game is presided over by a non-player known as the caller. At the beginning of the
game each player is given a card containing a unique combination of numbers from 0 to N
arranged in columns and rows. The caller has a bag containing N + 1 balls, numbered from 0
to N. On each turn, the caller randomly selects a ball from the bag, announces the number of
the drawn ball to the players, and sets the ball aside so that it cannot be selected again. Each
player searches his card for the called number and marks it if he finds it. The first player who
marks a complete pre-announced pattern on the card (for example, a full horizontal line) wins
a prize.
In the Albert-Charles-Mary version, on each turn, the caller draws a first ball, returns it to
the bag, draws a second ball, returns it to the bag, and then calls out the absolute difference
between the two ball numbers. To generate even more excitement, before the game started a
possibly empty subset of balls is removed from the bag, in such a way that at least two balls
remain there. They would like to know if every number from 0 to N may still be called out
with the new drawing method considering the balls that were left in the bag.
Input
Each test case is given using exactly two lines. The first line contains two integers N and B.
The meaning of N was described above (1 ≤ N ≤ 90), while B represents the number of balls
which remained in the bag (2 ≤ B ≤ N + 1). The second line contains B distinct integers bi,
indicating the balls which remained in the bag (0 ≤ bi ≤ N).
The last test case is followed by a line containing two zeros.
Output
For each test case output a single line containing a single uppercase ‘Y’ if is possible to call out
every number from 0 to N, inclusive, or a single uppercase ‘N’ otherwise.

 

 

Diana is going to write a list of all positive integers between A and B, inclusive, in base 10 and without any leading zeros. She wants to know how many times each digit is going to be used.

 

 

Input

 

Each test case is given in a single line that contains two integers A and B (1 ≤ A ≤ B ≤ 10^8 ). The last test case is followed by a line containing two zeros.

 

 

Output

 

 

For each test case output a single line with 10 integers representing the number of times each digit is used when writing all integers between A and B, inclusive, in base 10 and without leading zeros. Write the counter for each digit in increasing order from 0 to 9.

 

 

 

Sample input

1 9
12 321
5987 6123
12345678 12345679
0 0




Output for the sample input

 

0 1 1 1 1 1 1 1 1 1

61 169 163 83 61 61 61 61 61 61

134 58 28 24 23 36 147 24 27 47

0 2 2 2 2 2 2 2 1 1

 

 

 

 


Added by:psetter
Date:2010-11-04
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:ACM ICPC2010 – Latin American Regional

hide comments
2010-11-09 09:50:47 [Trichromatic] XilinX
Problem hidden because it's the same as problem MDIGITS.
2010-11-07 10:23:00 Dominik Kempa
I also get AC in g++ 4.0, TLE in 4.3
2010-11-07 06:31:00 ymGXX
use EOF.
2010-11-06 22:14:14 numerix
There is definitely something wrong with the input! There is at least one line that has not exactly two values, which causes problems using Python.
2010-11-06 16:36:20 Ehor Nechiporenko
How interesting I have compiled the same solution. But C++ 4.3 gave me TLE, but 4.0 was AC bu 0.07 sec.
2010-11-06 14:39:10 Priyank
I wonder why my solution is getting WA.I checked on official test cases and it is working fine.

Edit: Sorry. Precision error ! :D

Last edit: 2010-11-06 14:49:39
2010-11-06 02:23:30 abhijith reddy d
Is there something wrong with the input ?
Just reading input gives NZEC in python
http://ideone.com/sXxkH

Edit: Checking for EOF also gives AC ..

Last edit: 2010-11-06 02:29:31
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.