A. Little C Loves 3 I
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Little C loves number «3» very much. He loves all things about it.

Now he has a positive integer nn. He wants to split nn into 33 positive integers a,b,ca,b,c, such that a+b+c=na+b+c=n and none of the 33 integers is a multiple of 33. Help him to find a solution.

Input

A single line containing one integer nn (3≤n≤1093≤n≤109) — the integer Little C has.

Output

Print 33 positive integers a,b,ca,b,c in a single line, such that a+b+c=na+b+c=n and none of them is a multiple of 33.

It can be proved that there is at least one solution. If there are multiple solutions, print any of them.

Examples
input

Copy
3
output

Copy
1 1 1
input

Copy
233
output

Copy
77 77 79
被样例困惑了很久,看了题解啧啧,其实这题就是构造
大致题意:给你一个数n,找到三个数a,b,c,使得a+b+c=n,并且a,b,c都不能是3的倍数
分析:当n%3=0时,n-2一定不是3的倍数,可以构造为a=1,b=1,c=n-2;当n%3!=0时,n-3一定不是3的倍数,那么可以构造为,a=1,b=2,c=n-3.注意这个构造是任意的,只要满足条件即可
 #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
int n;
while(~scanf("%d",&n))
{
if(n%==)
printf("1 1 %d\n",n-);
else
printf("1 2 %d\n",n-);
}
return ;
}

1047A_Little C Loves 3 I(构造)的更多相关文章

  1. C 洛谷 P3599 Koishi Loves Construction [构造 打表观察]

    题目描述 Koishi决定走出幻想乡成为数学大师! Flandre听说她数学学的很好,就给Koishi出了这样一道构造题: Task1:试判断能否构造并构造一个长度为的的排列,满足其个前缀和在模的意义 ...

  2. hdu 5646DZY Loves Partition(构造)

    DZY Loves Partition  Accepts: 154  Submissions: 843  Time Limit: 4000/2000 MS (Java/Others)  Memory ...

  3. 洛谷P3599 Koishi Loves Construction 构造

    正解:构造 解题报告: 传送门! 这题俩问嘛,就分成两个问题港QwQ 就按顺序趴,先港第一问QwQ 首先要发现,n在膜n意义下就是0嘛 那作为前缀和的话显然它就只能放在第一个 然后再想下,发现,如果n ...

  4. P3599 Koishi Loves Construction——构造题

    题目 Task1:试判断能否构造并构造一个长度 $n$ 的 $1...n$ 的排列,满足其 $n$ 个前缀和在模 $n$ 的意义下互不相同 Task2:试判断能否构造并构造一个长度 $n$ 的 $1. ...

  5. BZOJ3569: DZY Loves Chinese II(线性基构造)

    Description 神校XJ之学霸兮,Dzy皇考曰JC. 摄提贞于孟陬兮,惟庚寅Dzy以降. 纷Dzy既有此内美兮,又重之以修能. 遂降临于OI界,欲以神力而凌♂辱众生.   今Dzy有一魞歄图, ...

  6. hdu 5675 ztr loves math(数学技巧)

    Problem Description ztr loves research Math.One day,He thought about the "Lower Edition" o ...

  7. [HDU5677]ztr loves substring

    ztr loves substring Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Othe ...

  8. 【BZOJ3563/3569】DZY Loves Chinese II 线性基神题

    [BZOJ3563/3569]DZY Loves Chinese II Description 神校XJ之学霸兮,Dzy皇考曰JC. 摄提贞于孟陬兮,惟庚寅Dzy以降. 纷Dzy既有此内美兮,又重之以 ...

  9. 【题解】P3599 Koishi Loves Construction

    [题解]P3599 Koishi Loves Construction \(\mod n\) 考虑如何构造,发现\(n\)一定在第一位,不然不行.\(n\)一定是偶数或者是\(1\),不然 \(n|\ ...

随机推荐

  1. 模拟实现ATM与购物商城

    一.功能介绍(第6条未实现)模拟实现一个ATM + 购物商城程序1额度15000或自定义2实现购物商城,买东西加入购物车,调用信用卡接口结账3可以提现,手续费5%4支持多账户登录5支持账户间转账6记录 ...

  2. Jmeter(十二)关联

    关联在实际业务需求中是随处可见的,比如:支付需要提交订单成功的订单号:修改个人资料需要登录成功响应报文信息...总之关联无处不在,今天来记一记Jmeter的关联功能. Jmeter关联的方法比较常用的 ...

  3. [UE4]删除动画:Remove from frame 5 to frame 18

    从当前帧开始删除到结尾的动画帧

  4. [UE4]条件融合动画: Blend Posed by int

    Aim Group=0:使用动画“Blend Pose 0” Aim Group=1:使用动画“Blend Pose 1”

  5. android实现3D Gallery 轮播效果,触摸时停止轮播

    1.轮播控件涉及到的两个类 CarouselViewPager.java public class CarouselViewPager extends ViewPager { @IntDef({RES ...

  6. MySQL 分区间进行数据展示 实例

    如何进行分区间数据统计示例 业务场景:统计消费总金额大于1000元的,800到1000元的,500到800元的,以及500元以下的人数. SELECT COUNT(CASE WHEN IFNULL(t ...

  7. linux system()函数详解

    system(3) - Linux man page Name system - execute a shell command Synopsis #include <stdlib.h> ...

  8. 数组.html

    <script > var arr1 = [1, 2, 3, 4, 5, 6 ]; 赋值 var arr2 =Array(1,2,3,4,5,6); var arr3 = new Arra ...

  9. IIS 禁止回收

    在IIS中找到这个站点所用的程序池,点击“高级设置...” 在打开的列表中更改以下设置: 回收 ——固定时间间隔(分钟) 改为 0 ——虚拟/专用内存限制(KB) 改为 0 进程模型 ——闲置超时(分 ...

  10. python操作符与流程控制

    操作符: 算术运算: +   -   *  /  %  //   ** 逻辑运算:and or  not 身份运算: is     not is 不可变数据类型:数字  字符串  字典key 可变数据 ...