首页 > 其他分享 >Codeforces867B-Save the problem!

Codeforces867B-Save the problem!

时间:2022-11-22 19:00:44浏览次数:91  
标签:Codeforces867B ways number cent pieces print problem Save change


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.

Example

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

题解:理解题意这题非常简单。我们只用1和2,通过计算我们可以发现ans=(n-1)*2。

Code:

var
n:longint;
begin
readln(n);
if n=1 then
begin
writeln('1 1');
writeln(1);
end else
begin
writeln((n-1)*2,' 2');
writeln('1 2');
end;
end.

标签:Codeforces867B,ways,number,cent,pieces,print,problem,Save,change
From: https://blog.51cto.com/u_15888102/5878367

相关文章

  • docker-ce在ubuntu:22.04进行apt update时报错E: Problem executing scripts APT::Upd
    使用docker-ce,pull一个ubuntu:22.04镜像,run后进行aptupdate更新一会,就报错:Readingpackagelists...DoneE:ProblemexecutingscriptsAPT::Update::Post-Invoke......
  • Compose 状态保存:rememberSaveable 原理分析
    ​前言我曾经在一篇​​介绍ComposeNavigation的文章​​中提到了Navigation的状态保存实际是由​​rememberSaveable​​实现的,有同学反馈希望单独介绍一下rememb......
  • CF803G Periodic RMQ Problem
    这题很妙,当时用CD的方法,写平衡树,但是吧没有领会精神,写了200多行,发现前驱后继又不合法的情况,好像要写12种情况,就不想写了。然后就突然明白线段树做法了。。。介绍一种线段......
  • [图论记录]arc124D Yet Another Sorting Problem
    题意:给定长度为\(n+m\)的排列\(p\),其中\(1-n\)位置为白色,\(n+1-n+m\)位置为黑色,每次交换一个白色位置与一个黑色位置的数,求把\(p\)变成升序的最少操作次数。link......
  • Codeforces Round #673 (Div. 2) Problem A
    今天的题。本来打算把比赛坚持打完的,但是因为生病了,还是早点睡吧,把第一题摸了。题面如下:BTheroisapowerfulmagician.Hehasgotnpilesofcandies,thei-thpile......
  • Codeforces Round #672 (Div. 2) ProblemB
    9月25日的打卡。为什么又过了零点?因为和朋友去摸鱼了。今天讲一下昨晚比赛的第二题。题面如下:Danikurgentlyneedsrockandlever!Obviously,theeasiestwaytoge......
  • Codeforces Round #672 (Div. 2) Problem A
    今日份的题目。(指9月24日,因为比赛从晚上10点半持续到12点半)问题A是水题,题面如下(大半夜了,就不翻译了,赶着睡觉)(其他题目明天再发)Wheatleydecidedtotrytomakeatestcha......
  • 洛谷题单【入门1】顺序结构-P1001 A+B Problem
    题目描述输入两个整数 a,ba,b,输出它们的和(|a|,|b|\le{10}^9∣a∣,∣b∣≤109)。 输入格式两个以空格分开的整数。输出格式一个整数。输入输出样例输......
  • RHEL8 使用iptables-save无法保存防火墙规则
    环境RHEL8原因使用iptables-save命令执行后,无法保存iptables防火墙的规则,在下次重启系统后,会导致防火墙的规则链给重置到默认的规则链。解决使用maniptables-save查......
  • L10U5-3 Dealing with an employee's problem 20221113
    ExpressionsProblemsbehaviorDescribingproblembehavioronthejobUsetheseexpressionstoaskaboutanddescribeproblembehavioronthejob.A.What'sup?......