ural 1437. Gasoline Station

1437. Gasoline Station

Time limit: 1.0 second
Memory limit: 64 MB
Once a gasoline meter broke at a filling station. Fortunately, there was an overflow clipper (a device that makes it possible not to overfill a tank).
An ACM-programmer came to this station and saw an announcement saying that the station didn't work properly. As he was meditating on what to do next, he noticed three empty cans at the station's counter. He thought: "If I fill the first can and then empty it to the second one, and then take the third one… Maybe, I'll be able to measure out the needed amount of gasoline?"
As usual, he began to think about a general formulation of the problem, forgetting the partial case: "How many different capacities can I measure out using these cans?"
Of course, it is forbidden to spill gasoline because of ecology reasons. Also, the station's owner requires that gasoline only be transferred from the storage tank to a can or between cans. The car's tank may be filled from one or several of the cans only after all of the transfers.

Input

Each of the three input lines contains an integer from 0 to 255, which is the capacity of a gasoline can in liters.

Output

The result is an integer that is the number of different answers to the question how many liters the programmer can measure out using the gasoline cans with the specified capacities.

Sample

inputoutput
0 
3
4
6

Notes

There is no sense to measure out 0 liters, so this value must not be counted.
Problem Author: Alexey Lakhtin
Problem Source: The 7th USU Open Personal Contest - February 25, 2006

转载于:https://www.cnblogs.com/StupidBoy/p/4979129.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值