Not an official ACM page
| 1994 Western European Regional problem set
| My ACM problem archive
| my home page]
1994-1995 ACM International Collegiate Programming Contest
Western European Regional
In this age of Internet, on-line connections, instantaneous email
etc., there are still some of the unhappy few who need to work with
floppy disks. John is one of those. Every evening he goes home and
wants to continue what he was doing at work on his private UNIX
system. Thus, every night he considers the files he needs, and then
puts them on one or more floppy disks.
For this, he has developed the following procedure:
This procedure so far always worked, since 1.86 of uuencoded text,
after compression, will nicely fit on a 1.44 Mb floppy disk.
- First, put all the files in one big SHAR file.
- Then compress the file.
- Next, uuencode it, such that it is split in nice lines of 62
characters each (including the newline).
- Then, split it in files of 30,000 lines each (so that it is about 1.86 Mb).
- Then compress each of the files and put it on a floppy by itself.
Now, given that, through compression, the size of the SHAR file halves
and that uuencoding a compressed file adds 50% to its size (each
rounded to the nearest integer number of bytes), we would like to know
for a given size of the SHAR file, how many floppies John needs.
The first line of input contains an integer N, specifying the
number of test cases. Each test case consists of a single line
containing one integer S (0 <= S <=
1,000,000,000), being the size of the SHAR file in bytes.
For each test case write the following sentence: '
bytes of SHAR file, F floppies are needed.', where
B is the size of the SHAR file in bytes, and F is
the minimum number of floppies needed for the transfer.
For 1000000 bytes of SHAR file, 1 floppies are needed.
For 10000000 bytes of SHAR file, 5 floppies are needed.
For 100000000 bytes of SHAR file, 41 floppies are needed.
This page maintained by
Last updated September 20, 1999