[Hidden]
#### 1212. C. Fold the Paper Nicely

#### Description

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.

The Problem:

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.

#### Input

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.

#### Output

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

Sample Output.

#### Samples

#### Source

UCF2012

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.

The Problem:

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.

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.

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

Sample Output.

Input
Copy

3 60 51 4 3 2 50 3 2 1

Output

Data set: 60 51 4 15 12 Data set: 3 2 50 0 0 Data set: 3 2 1 2 1

Time Limit: | 1000MS (C/C++,Others×2) |

Memory Limit: | 128MB (C/C++,Others×2) |

Special Judge: | No |

AC/Submit: | 1 / 1 |

Tags: |