B. Save the problem! http://codeforces.com/contest/867/problem/B

time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

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

题意:先给你一个数 a 表示方案数,   让你任意来给出两行 第一行两个数 n 和 m,第二行 m 个数  ,即 你所给出的 m个数 有a种不同的方案可以构成n ,与正常题刚好反过来,那么我们只要考虑最简单的情况 1 和 2 ,那么n = a*2+1

#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5+5;
const int inf = 0x3f3f3f3f;
int main()
{
ios::sync_with_stdio(false);
int a,ans;
while(cin >> a)
{
if(a==1)
{
printf("1 1\n");
printf("1\n");
continue;
}
ans = 2*a-1;
printf("%d 2\n",ans);
printf("1 2\n");
}
return 0;
}

CodeForces 867B Save the problem的更多相关文章

  1. B - Save the problem! CodeForces - 867B 构造题

    B - Save the problem! CodeForces - 867B 这个题目还是很简单的,很明显是一个构造题,但是早训的时候脑子有点糊涂,想到了用1 2 来构造, 但是去算这个数的时候算错 ...

  2. [codeforces 528]B. Clique Problem

    [codeforces 528]B. Clique Problem 试题描述 The clique problem is one of the most well-known NP-complete ...

  3. codeforces.com/contest/325/problem/B

    http://codeforces.com/contest/325/problem/B B. Stadium and Games time limit per test 1 second memory ...

  4. Codeforces 442B Andrey and Problem(贪婪)

    题目链接:Codeforces 442B Andrey and Problem 题目大意:Andrey有一个问题,想要朋友们为自己出一道题,如今他有n个朋友.每一个朋友想出题目的概率为pi,可是他能够 ...

  5. Codeforces 776D The Door Problem

    题目链接:http://codeforces.com/contest/776/problem/D 把每一个钥匙拆成两个点${x,x+m}$,分别表示选不选这把钥匙. 我们知道一扇门一定对应了两把钥匙. ...

  6. codeforces 803G Periodic RMQ Problem

    codeforces 803G Periodic RMQ Problem 题意 长度为\(1e5\)的数组复制\(1e4\)次,对新的数组进行区间覆盖和区间最小值查询两种操作,操作次数\(1e5\). ...

  7. [Codeforces 986E] Prince's Problem

    [题目链接] https://codeforces.com/contest/986/problem/E [算法] X到Y的路径积 , 可以转化为X到根的路径积乘Y到根的路径积 , 除以LCA到根的路径 ...

  8. 【codeforces 527D】Clique Problem

    [题目链接]:http://codeforces.com/contest/527/problem/D [题意] 一维线段上有n个点 每个点有坐标和权值两个域分别为xi,wi; 任意一对点(i,j) 如 ...

  9. 【codeforces 793C】Mice problem

    [题目链接]:http://codeforces.com/contest/793/problem/C [题意] 给你每个点x轴移动速度,y轴移动速度; 问你有没有某个时刻,所有的点都"严格& ...

随机推荐

  1. VS编译后直接复制DLL库文件到其他目录下

    项目目录:SourceCode\公共组件\KApiClient\ 要复制的目的目录: SourceCode\公共组件\DllLibrary\ApiClient 则在项目 KApiClient下添加如下 ...

  2. 解决ConfigParser配置option的大小写问题

    通常情况下,我们会这样解析配置文件: confiig = ConfigParser.ConfigParser() config.read('xxx.ini') #这个read表示对某个文件用读打开, ...

  3. HashMap(JDK1.8)

      四个构造函数: 构造方法只是赋值属性初始值但是不会真正初始化数组表空间,在第一次添加元素时形成数组表空间.这个和以往的jDK1.7之前的不同,1.7之前的都是在构造里初始化了table数组空间. ...

  4. grad-cam 、cam 和热力图,基于keras的实现

    http://bindog.github.io/blog/2018/02/10/model-explanation/ http://www.sohu.com/a/216216094_473283 ht ...

  5. Python pyodbc安装

    1)下面这个链接找个适合自己python版本的文件下载下来 https://pypi.org/project/pyodbc/#files 2)放到scripts下面 3) 在scripts路径上输入c ...

  6. SQL Server双机热备之后项目的FailOver自动连接

    SQL Server配置数据库镜像后,可能有朋友们会比较有疑惑,你一下搞两个数据库出来,他们的ip地址都不一样,到时候数据库切换过去了,我的数据库的连接字符串可如何是好?难道还得在代码中去控制是连接哪 ...

  7. how to backup your system of Autel MS908 Pro

    how to backup your system of Autel Scan Tool Autel MS908 Pro: Connect the tablet to a PC desktop or ...

  8. git从安装到使用

    一.Git简介 Git是一个开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目. Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制 ...

  9. Django框架----路由系统、视图和模板(简单介绍)

    一.路由配置系统(urls) URL配置(URLconf)就像Django所支撑网站的目录.它的本质是URL与要为该URL调用的视图函数之间的映射表: 你就是以这种方式告诉Django,对于这个URL ...

  10. OpenGL读取帧缓存数据

    https://blog.csdn.net/niu2212035673/article/details/80251949 简述有些时候我们可能需要获取渲染后的图像数据,比较常用的函数是glReadPi ...