日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

*【CodeForces - 1047A】Little C Loves 3 I (水题,构造,三元组问题)

發(fā)布時(shí)間:2023/12/10 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 *【CodeForces - 1047A】Little C Loves 3 I (水题,构造,三元组问题) 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

題干:

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

3

Output

1 1 1

Input

233

Output

77 77 79

解題報(bào)告:

? 還有一個(gè)后續(xù)題目,是關(guān)于曼哈頓距離的,暫時(shí)還沒(méi)學(xué),題解先放著? ?我是題解

? ?這道題就比較水了啊,屬于三元組但是卻不需要這么分析,因?yàn)閚太大了,1e9,所以考慮構(gòu)造。

? 其實(shí)也比較好構(gòu)造啊,,比較容易滿足題意。

#include<bits/stdc++.h>using namespace std;int main() {int n;int a,b,c;cin>>n;if(n%3==0) {a=1;b=1;c=n-a-b;}else {a=1,b=2;c=n-a-b;}printf("%d %d %d\n",a,b,c);return 0; }

AC代碼:

?

總結(jié)

以上是生活随笔為你收集整理的*【CodeForces - 1047A】Little C Loves 3 I (水题,构造,三元组问题)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。