Save the problem!
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.
Input
Input will consist of a single integer A (1 ≤ A ≤ 105), the desired number of ways.
Output
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 D1, D2, ..., DM (1 ≤ Di ≤ 106), the denominations of the coins. All denominations must be distinct: for any i ≠ j we must have Di ≠ Dj.
If there are multiple tests, print any of them. You can print denominations in atbitrary order.
Examples
Input
18
Output
30 4 1 5 10 25
Input
3
Output
20 2 5 2
Input
314
Output
183 4 6 5 2 139
题意:给你一个构成硬币的方案数,要你求 兑换的硬币,所需的硬币种类,可兑换的硬币的值。例如,如果你的变化是30美分,收银员可以给你5美分和25美分,或者他们可以给你3个10美分,或10个1美分,2个5美分和1个10美分片。总共有18种不同的方法可以使用1美分,5美分,10美分和25美分来制作30美分。
思路:一开始我看见这个题目懵逼了,然后就没写出来。最后看题解,才发现 为什么要用方案数这一个条件去推算 所需的答案,却没想到 用固定的 可兑换的硬币,以及方案数 来 推算 需要兑换的硬币,最后输出就可以。!!!! 当然最简单的情况,可兑换成的硬币 只有 1,2 两种,最后就找规律就可以了。。。。思维,,, QAQ,智商压制!!。
AC代码:
#include<bits/stdc++.h>
using namespace std;
int main()
{
int A;
while(~scanf("%d",&A)){
if(A == 1){
printf("1 1\n1\n");
continue;
}
printf("%d 2\n",A * 2 - 1);
printf("1 2\n");
}
return 0;
}