How to make this program? (PLEASE HELP)

Hi I have this assignment but I can't figure out how to make it. If someone could make a working program it will greatly help me.

The input will be two lines of 6 numbers (with spaces between them), they will represent respectivelly (the first line is whites, the second is black) the number of Kings, the number of Queens, the number of Rocks, the number of Bishops, the number of Knights and the number of Soldiers.

The use of the program is to find how many full sets of chess you can assemble with the given numbers. Heres an example of the input/output

INPUT

2 3 4 5 6 20
3 2 5 6 4 18

OUTPUT

2

I really hope you can help me. Thanks in advance!!
One chess set object needs one Black object and one White object for construction
The White object in turn needs 1K, 1Q, 2R, 2B, 2K and 8S for construction, so after reading in the first line, the number of White object(s) that can be constructed is:
min ( min (2, 3), 4/2, 5/2, 6/2, 20/8) //integer division is fine in this case
Similar for the Black object
And the number of chess set objects is min (# White objects, #Black objects)
Last edited on
Topic archived. No new replies allowed.