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. EL语言表达式 (二)【EL对数据的访问】

    一.访问方式: EL中访问数据和Java中访问数组的方式相同,即可以通过“[]”和“.”运算符进行访问.而且两种形式是等价的.如: 访问JavaBean对象userInfo中的id属性,可以写成下面两 ...

  2. 基于MySQL提供的Yum repository安装MySQL5.6

    基于MySQL提供的Yum repository安装MySQL5.6 1:下载YUM包 1.1切换到root用户: 1)su - root 2)wget http://dev.mysql.com/ge ...

  3. Git branch 分支与合并分支

    Git branch 分支 查看当前有哪些branch bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch * master 新建一 ...

  4. java基础练习2

    1, 写一段代码, 可以取出任意qq邮箱地址中的qq号码 public class Test { public static void main(String[] args) { String str ...

  5. html5-section元素

    <!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8&qu ...

  6. Codeforces Round #319 (Div. 2) D

    E A tree of size n is an undirected connected graph consisting of n vertices without cycles. Conside ...

  7. 只打开一次浏览器,生成html测试报告<小紧张中......>

    from selenium import webdriverimport unittestimport time class Blog(unittest.TestCase): "" ...

  8. 解读 JavaScript 之引擎、运行时和堆栈调用

    https://www.oschina.net/translate/how-does-javascript-actually-work-part-1 随着 JavaScript 变得越来越流行,很多团 ...

  9. RESTful API 设计指南,RESTful API 设计最佳实践

    RESTful API 设计指南,RESTful API 设计最佳实践 网络应用程序,分为前端和后端两个部分.当前的发展趋势,就是前端设备层出不穷(手机.平板.桌面电脑.其他专用设备......). ...

  10. URL some

    ** 路由系统:URL配置(URLconf)就像Django所支撑网站的目录. 本质是URL与该URL要调用的函数的映射表 基本格式 : from django.conf.urls import ur ...