301292: CF241G. Challenging Balloons

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Challenging Balloons

题目描述

Martha — as a professional problemsetter — proposed a problem for a world-class contest. This is the problem statement: Tomorrow is Nadia's birthday, and Bardia (her brother) is assigned to make the balloons ready! There are $ n $ balloons (initially empty) that are tied to a straight line on certain positions $ x_{1},x_{2},...,x_{n} $ . Bardia inflates the balloons from left to right. As a result, $ i $ -th balloon gets bigger and bigger until its radius reaches the pressure endurance $ p_{i} $ or it touches another previously-inflated balloon. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF241G/ad76c1ea81bca8ad7b086e9e6da5329cfb0428b0.png)While Bardia was busy with the balloons, he wondered "What will be the sum of radius of balloons after all of the balloons are inflated?". Being a nerdy type of guy, he is now thinking about the problem instead of preparing his sister's birthday. Calculate the answer to Bardia's problem so that Nadia's birthday won't be balloon-less. Artha — Martha's student — claimed his solution got accepted. Martha (being his teacher for a long time!) knew he couldn't have solved the problem for real and thus thinks there is something wrong with the testcases. Artha isn't anyhow logical, which means there is no way for Martha to explain the wrong point in his algorithm. So, the only way is to find a testcase to prove him wrong! Artha's pseudo-code is shown below: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF241G/6e961f208c0c9a0d7488024c73cdaa09ded78277.png)You should output a small testcase for the problem such that Artha's algorithm is incorrect. The algorithm's output is considered correct if it differs from the correct value by no more than 1.

输入输出格式

输入格式


Please pay attention! No input will be given to your program for this problem. So you do not have to read from the input anything.

输出格式


You should output the generated small testcase (which Artha's solution doesn't get it right). It should be in the following format: - First line must contain the only number $ n $ ( $ 1<=n<=500 $ ). - The $ i $ -th of the next $ n $ lines should contain the description of the $ i $ -th balloon — two space-separated integers $ x_{i},p_{i} $ ( $ 1<=p_{i}<=10^{6} $ , $ 0<=x_{1}&lt;x_{2}&lt;...&lt;x_{n}<=10^{6} $ ).

输入输出样例

暂无测试点

说明

The testcase depicted in the figure above (just showing how output should be formatted): `<br></br>4<br></br>0 9<br></br>6 3<br></br>12 7<br></br>17 1<br></br>`

Input

题意翻译

### 题目背景 这是一道 **hack 题**。在本题目中,你将得到一个问题和一个解决对应问题的**伪代码**,但是给出的伪代码不能对于某些输入给出正确的输出。 对于这一问题,你需要提交一份符合要求的输入数据,使得给定的代码不能给出正确的输出。 ### 目标题目描述 以下给出这道题目的题目描述: 有 $n$ 个气球分别在 $x_1,x_2,\ldots,x_n(x_1<x_2<\cdots<x_n)$ 的位置上。第 $i$ 个气球还有一个最大半径限度 $p_i$。 一开始所有的气球都没有充气,体积可以视为 $0$。然后,你将对这 $n$ 个气球**从左到右**进行如下的操作: - 对该气球充气,直到它碰撞到其他任意一个气球或半径达到半径限度 $p_i$; 你需要求出所有气球的半径和。 ### 提示 如果不理解气球的充气过程,可以参照如下的例子。 在这个例子里,$x=\{0,6,12,17\}$,$p=\{9,3,7,1\}$。全部操作结束后所有气球会看起来像这样: ![样例](https://cdn.luogu.com.cn/upload/vjudge_pic/CF241G/ad76c1ea81bca8ad7b086e9e6da5329cfb0428b0.png) ### 目标代码 你需要 hack 如下的**伪代码**: ![伪代码](https://cdn.luogu.com.cn/upload/vjudge_pic/CF241G/6e961f208c0c9a0d7488024c73cdaa09ded78277.png) ### 数据规模要求与输出格式 第一行包括一个正整数 $n(1\le n\le 500)$; 接下来 $n$ 行,第 $i$ 行包括两个非负整数 $x_i,p_i(0\le x_1<x_2<\cdots<x_n\le 10^6,1\le p_i\le 10^6)$。 例如,你要参照以下样例的格式输出(注意,这并不是正确的答案,仅仅用于展示格式): ``` 4 0 9 6 3 12 7 17 1 ``` 翻译自 @[zyc212303](https://www.luogu.com.cn/user/556366)。

加入题单

算法标签: