SPOJ HANGOVER

902 (HANGOVER) - Hangover

 * SPOJ HANGOVER
 * TJU 1920
 * PKU 1003

Summary
How many cards in a stack can overhang from a table?

Given a distance between 0.01 to 5.20 inclusive, return the number of cards required for the overhang length. In general, n cards can overhang to 1/2 + 1/3 + 1/4 + ... + 1/(n+1) card lengths.

Implementations
This is a straight foraward problem. Given the limited nature of answers, it's possible to build the entire set of answers in a 520-element array.

Input
1.00 3.71 0.04 5.19 0.00

Output
3 card(s) 61 card(s) 1 card(s) 273 card(s)