CF241C Mirror Box
Description
Mirror Box is a name of a popular game in the Iranian National Amusement Park (INAP). There is a wooden box, $ 10^{5} $ cm long and $ 100 $ cm high in this game. Some parts of the box's ceiling and floor are covered by mirrors. There are two negligibly small holes in the opposite sides of the box at heights $ h_{l} $ and $ h_{r} $ centimeters above the floor. The picture below shows what the box looks like.
In the game, you will be given a laser gun to shoot once. The laser beam must enter from one hole and exit from the other one. Each mirror has a preset number $ v_{i} $ , which shows the number of points players gain if their laser beam hits that mirror. Also — to make things even funnier — the beam must not hit any mirror more than once.
Given the information about the box, your task is to find the maximum score a player may gain. Please note that the reflection obeys the law "the angle of incidence equals the angle of reflection".
Input Format
The first line of the input contains three space-separated integers $ h_{l},h_{r},n $ ( $ 0<h_{l},h_{r}<100 $ , $ 0
Output Format
The only line of output should contain a single integer — the maximum possible score a player could gain.
Explanation/Hint
The second sample is depicted above. The red beam gets $ 10+50+5+35+8+2=110 $ points and the blue one gets $ 120 $ .
The red beam on the picture given in the statement shows how the laser beam can go approximately, this is just illustration how the laser beam can gain score. So for the second sample there is no such beam that gain score 110.