eolymp
bolt
Try our new interface for solving problems
Problems

Lucky Controller

Lucky Controller

Egor works as a conductor in the bus. Each day he is given a pack of tickets which he then sells. Recently he has become interested about how many tickets in the pack are lucky. He thinks that the more tickets are lucky the luckier day he will have. Now he wants to find out how lucky for him the next day is going to be. Each ticket number consist of \textbf{n} digits. The ticket is considered to be lucky if the sum of the first \textbf{n}/\textbf{2} digits equals to the sum of the last \textbf{n}/\textbf{2} digits. Egor knows that the numbers in the pack that he will be given can start with equal probability from any number in the interval from \textbf{a} to \textbf{b} inclusively. The pack holds \textbf{k} tickets. The numbers of the tickets are consecutive. Help Egor to find an expected quantity of lucky tickets in the pack. \InputFile The input file consists of a single line with three integers \textbf{a}, \textbf{b} and \textbf{k} (\textbf{0} ≤ \textbf{a} ≤ \textbf{b} < \textbf{10^12}, \textbf{1} ≤ \textbf{k} ≤ \textbf{100000}). Integers \textbf{a} and \textbf{b} consist of same amount of digits, and this amount equals to the amount of digits in the number of each ticket. They may start with zeroes. The amount of digits in \textbf{a} and \textbf{b} is always even. \OutputFile Output the expected quantity of lucky tickets in the pack in the form of irreducible fraction. In case the result is an integer -- no slash should appear in the output.
Time limit 1 second
Memory limit 64 MiB
Input example #1
0123 4567 150
Output example #1
6519/635