usaco——milk3
来源:互联网 发布:淘宝开店取什么名字好 编辑:程序博客网 时间:2024/06/05 07:36
Mother's Milk
Farmer John has three milking buckets of capacity A, B, and C liters. Each of the numbers A, B, and C is an integer from 1 through 20, inclusive. Initially, buckets A and B are empty while bucket C is full of milk. Sometimes, FJ pours milk from one bucket to another until the second bucket is filled or the first bucket is empty. Once begun, a pour must be completed, of course. Being thrifty, no milk may be tossed out.
Write a program to help FJ determine what amounts of milk he can leave in bucket C when he begins with three buckets as above, pours milk among the buckets for a while, and then notes that bucket A is empty.
PROGRAM NAME: milk3
INPUT FORMAT
A single line with the three integers A, B, and C.
SAMPLE INPUT (file milk3.in)
8 9 10
OUTPUT FORMAT
A single line with a sorted list of all the possible amounts of milk that can be in bucket C when bucket A is empty.
SAMPLE OUTPUT (file milk3.out)
1 2 8 9 10
SAMPLE INPUT (file milk3.in)
2 5 10
SAMPLE OUTPUT (file milk3.out)
5 6 7 8 9 10
- usaco——milk3
- usaco milk3
- usaco milk3
- usaco milk3
- USACO milk3 DFS
- usaco 1.4.2 milk3
- USACO之milk3
- usaco 1.4 milk3 2008.11.5
- USACO-Section1.4 milk3[深搜]
- USACO 1.4 Mother's Milk (milk3)
- usaco——gift1
- usaco——Friday
- usaco——beads
- usaco——milk2
- usaco——transform
- usaco——namenum
- usaco——palsquare
- usaco——dualpal
- 诺基亚与Intel结盟:Moblin+Maemo->MeeGo!
- if Vs switch,即生瑜何生亮!
- Ubuntu下Wine乱码解决方
- 2010的最刺激的电脑技术
- 两个for循环输出菱形
- usaco——milk3
- 获取操作系统版本
- usaco——numtri
- getopt library in windows
- usaco——pprime
- rdesktop架构解析(RDP协议分析)
- TStringList 常用方法与属性
- usaco——sprime
- usaco——checker