PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#QHD0000064. Đổi tiền đô la New Zealand (Dollars)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đổi tiền đô la New Zealand (Dollars)

Dollars

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

New Zealand currency has banknotes worth 100100, 5050, 2020, 1010, and 55 dollars, and coins worth 22 and 11 dollars, and 5050, 2020, 1010, and 55 cents. You have an unlimited number of each denomination.

Two ways to make an amount are considered the same if they use exactly the same quantity of every denomination, regardless of the order of the notes and coins. For example, 0.200.20 dollars can be formed in four ways: one 2020-cent coin; two 1010-cent coins; one 1010-cent coin plus two 55-cent coins; or four 55-cent coins.

Given an amount AA written in dollars with exactly two decimal digits, count the number of different combinations of notes and coins that sum to exactly AA. Print the exact count, without a modulus, and preserve the specified right-aligned output columns. Every amount is a multiple of 0.050.05 dollars.

Input

One amount AA on a line, containing exactly two digits after the decimal point (for example 2.00 or 0.20). There is no terminating 0.00 record in this version.

Output

Print exactly one line containing two adjacent fields: first the amount with two fractional digits, right-aligned in a field of width 66; then the exact number of combinations, right-aligned in a field of width 1717. Insert no extra separator apart from the padding spaces. Use an integer type wide enough for the answer.

Subtasks

  • Subtask 1 (20 points): 0.05≤A≤2.000.05\le A\le2.00 dollars, with AA a multiple of 0.050.05 and exactly two fractional digits.

  • Subtask 2 (30 points): 0.05≤A≤30.000.05\le A\le30.00 dollars, with AA a multiple of 0.050.05 and exactly two fractional digits.

  • Subtask 3 (50 points): 0.05≤A≤300.000.05\le A\le300.00 dollars, with AA a multiple of 0.050.05 and exactly two fractional digits.

Examples

Input

0.20

Output

  0.20                4

Explanation

The amount 0.20 is 2020 cents. The only usable denominations are 55, 1010, and 2020 cents. The four combinations are: 2020; 10+1010+10; 10+5+510+5+5; and 5+5+5+55+5+5+5. Thus the count is 44. The text 0.20 occupies four characters and receives two leading spaces in its six-character field; the integer 4 is right-aligned within the following seventeen-character field.