当前位置: 首页 > 工具软件 > Booklet > 使用案例 >

『杭电1117』Booklet Printing

盖嘉庆
2023-12-01

Problem Description

When printing out a document, normally the first page is printed first, then the second, then the third, and so on until the end. However, when creating a fold-over booklet, the order of printing must be altered. A fold-over booklet has four pages per sheet, with two on the front and two on the back. When you stack all the sheets in order, then fold the booklet in half, the pages appear in the correct order as in a regular book.
For example, a 4-page booklet would print on 1 sheet of paper: the front will contain page 4 then page 1, and the back will contain page 2 then page 3.

Front Back
------------- -------------
| | | | | |
| 4 | 1 | | 2 | 3 |
| | | | | |
------------- -------------

Your task is to write a program that takes as input the number of pages to be printed, then generates the printing order.

 类似资料: