Name: Anonymous 2010-10-03 15:59
Hey
I really need help on my programming assignment. I’ve been thinking about it for hours and just can’t come up with an algorithm to solve it. It’s a mind fuck. Whatever I think of doesn’t work. I also have to give it away in 2 hours.
Here it is:
There are n (1 ≤ n ≤ 100) sheets of paper with various dimensions. Every sheet is divided by 2 lines into 4 rectangular parts. The dimensions (length and width) for those 4 parts are known (entered via console). Find the dimensions of each sheet of paper.
All numbers are integers.
E.g.
From keyboard:
1 // one sheet of paper
3 2 8 3 7 2 8 7 // dimensions for each part. Part1 would be three units long and two units wide ; etc…
Answer:
10 10
I really need help on my programming assignment. I’ve been thinking about it for hours and just can’t come up with an algorithm to solve it. It’s a mind fuck. Whatever I think of doesn’t work. I also have to give it away in 2 hours.
Here it is:
There are n (1 ≤ n ≤ 100) sheets of paper with various dimensions. Every sheet is divided by 2 lines into 4 rectangular parts. The dimensions (length and width) for those 4 parts are known (entered via console). Find the dimensions of each sheet of paper.
All numbers are integers.
E.g.
From keyboard:
1 // one sheet of paper
3 2 8 3 7 2 8 7 // dimensions for each part. Part1 would be three units long and two units wide ; etc…
Answer:
10 10