Dr. Orooji has a daily calendar (365 pages) on his desk. Every morning, he tears off one page
and, as he is reading the notes on the next page, he folds (out of habit) the sheet in his hand. Dr.
O noticed that he always folds the sheet (a rectangular paper) along the longer side, e.g., if one
side is 80 and the other side is 60, he would fold along 80; this will make the paper of size 40
and 60; if he folds it again, he would fold along 60 since that’s the longer side now.
Given a rectangular piece of paper and how many times Dr. O folds it, you are to determine the
final sizes. When folding a side with an odd length, the fraction is ignored after folding, e.g., if a
side is 7, it will become 3 after folding.
The first input line contains a positive integer, n, indicating the number of data sets. The sets are
on the following n input lines, one set per line. Each set contains three positive integers (each ≤
10000), the first two providing the rectangle sides and the third providing the number of folds.
At the beginning of each test case, output “Data set: v” where v is the input values. Then,
on the next output line, print the final values for the rectangle (larger side of the final values
first). Leave a blank line after the output for each test case. Follow the format illustrated in
60 51 4
3 2 50
3 2 1
Data set: 60 51 4
Data set: 3 2 50
Data set: 3 2 1