CF865A.Save the problem!

普及/提高-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Attention: we lost all the test cases for this problem, so instead of solving the problem, we need you to generate test cases. We're going to give you the answer, and you need to print a test case that produces the given answer. The original problem is in the following paragraph.

People don't use cash as often as they used to. Having a credit card solves some of the hassles of cash, such as having to receive change when you can't form the exact amount of money needed to purchase an item. Typically cashiers will give you as few coins as possible in change, but they don't have to. For example, if your change is 30 cents, a cashier could give you a 5 cent piece and a 25 cent piece, or they could give you three 10 cent pieces, or ten 1 cent pieces, two 5 cent pieces, and one 10 cent piece. Altogether there are 18 different ways to make 30 cents using only 1 cent pieces, 5 cent pieces, 10 cent pieces, and 25 cent pieces. Two ways are considered different if they contain a different number of at least one type of coin. Given the denominations of the coins and an amount of change to be made, how many different ways are there to make change?

As we mentioned before, we lost all the test cases for this problem, so we're actually going to give you the number of ways, and want you to produce a test case for which the number of ways is the given number. There could be many ways to achieve this (we guarantee there's always at least one), so you can print any, as long as it meets the constraints described below.

注意:本题的所有测试用例均已丢失,因此你无需解题,而是需要生成测试用例。我们将给出一个答案(即方案数),而你需要输出一个能产生该答案的测试用例。原题描述如下:

如今人们使用现金的频率已不如从前。拥有一张信用卡可解决现金带来的一些麻烦,例如在购买商品时,若无法恰好凑出所需金额,则无需找零。通常收银员会以最少数量的硬币找零,但这并非强制要求。例如,若需找零 30 美分,收银员可以给你一枚 5 美分硬币和一枚 25 美分硬币;也可以给你三枚 10 美分硬币;还可以给你十枚 1 美分硬币、两枚 5 美分硬币和一枚 10 美分硬币。仅使用 1 美分、5 美分、10 美分和 25 美分硬币,总共有 18 种不同的方式凑出 30 美分。若两种方式中至少某一种面额的硬币数量不同,则视为不同方案。给定硬币面额集合及需找零的金额,问一共有多少种不同的找零方案?

如前所述,本题所有测试用例均已丢失,因此我们实际会提供一个方案数,而你需要构造一个满足该方案数的测试用例。可能有多种构造方式(我们保证至少存在一种),你只需输出任意一个满足下述约束条件的测试用例即可。

输入格式

Input will consist of a single integer A (1 ≤ A ≤ 105), the desired number of ways.

输入将包含一个整数 AA(1 ≤ A ≤ 1051 \leq A \leq 10^5),表示所期望的方案数。

输出格式

In the first line print integers N and M (1 ≤ N ≤ 106, 1 ≤ M ≤ 10), the amount of change to be made, and the number of denominations, respectively.

Then print M integers _D_1, _D_2, ..., D__M (1 ≤ D__i ≤ 106), the denominations of the coins. All denominations must be distinct: for any i ≠ j we must have D__i ≠ D__j.

If there are multiple tests, print any of them. You can print denominations in atbitrary order.

第一行输出两个整数 NN 和 MM(1≤N≤1061 \leq N \leq 10^6,1≤M≤101 \leq M \leq 10),分别表示需要凑出的金额和硬币面额的种类数。

随后输出 MM 个整数 D1, D2, …, DMD_1,\ D_2,\ \dots,\ D_M(1≤Di≤1061 \leq D_i \leq 10^6),表示硬币的面额。所有面额必须互不相同:对任意 i≠ji \neq j,均有 Di≠DjD_i \neq D_j。

若存在多个可行解,输出任意一个即可。面额的输出顺序可以任意。

输入输出样例

  • 输入#1

    18

    输出#1

    30 4
    1 5 10 25
  • 输入#2

    3

    输出#2

    20 2
    5 2
  • 输入#3

    314

    输出#3

    183 4
    6 5 2 139

输入解题思路,AI测评打分。不知道怎么写?

首页