bryce1010模板

http://codeforces.com/gym/101810

#include <bits/stdc++.h>

using namespace std;
#define ll long long
int main() {
int T;
cin >> T;
while (T--)
{
ll n, x;
cin >> x >> n;
if (n == 1) {
cout << x << endl;
continue;
}
ll time = x / (2 * n - 2);
ll ad = x % (2 * n - 2);
vector<ll>ans(n);
for (int i(0); i < n; i++) {
if (i != 0 && i != n - 1)ans[i] += time * 2;
else ans[i] += time;
}
for (int i(0); i < n&&ad > 0; i++, ad--) {
ans[i]++;
}
for (int i(n - 2); ad > 0; ad--, i--) {
ans[i]++;
}
for (int i(0); i < n; i++) {
if (i == 0)cout << ans[i];
else cout << " " << ans[i];
}
cout << endl;
}
return 0;
}

Gym - 101810B ACM International Collegiate Programming Contest (2018)的更多相关文章

  1. Gym - 101810H ACM International Collegiate Programming Contest (2018)

    bryce1010模板 http://codeforces.com/gym/101810 #include <bits/stdc++.h> using namespace std; #de ...

  2. Gym - 101810F ACM International Collegiate Programming Contest (2018)

    bryce1010模板 http://codeforces.com/gym/101810 #include<bits/stdc++.h> using namespace std; #def ...

  3. Gym - 101810E ACM International Collegiate Programming Contest (2018)

    bryce1010模板 http://codeforces.com/gym/101810 #include<bits/stdc++.h> using namespace std; #def ...

  4. Gym - 101810D ACM International Collegiate Programming Contest (2018)

    bryce1010模板 http://codeforces.com/gym/101810 #include <bits/stdc++.h> using namespace std; #de ...

  5. Gym - 101810C ACM International Collegiate Programming Contest (2018)

    bryce1010模板 http://codeforces.com/gym/101810 #include <bits/stdc++.h> using namespace std; #de ...

  6. Gym - 101810A ACM International Collegiate Programming Contest (2018)

    bryce1010模板 http://codeforces.com/gym/101810/problem/A 大模拟,写崩了,代码借队友的...... 注意处理段与段的连接问题: #include&l ...

  7. ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2018) Syria, Lattakia, Tishreen University, April, 30, 2018

    ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2018) Syr ...

  8. ACM International Collegiate Programming Contest World Finals 2014

    ACM International Collegiate Programming Contest World Finals 2014 A - Baggage 题目描述:有\(2n\)个字符摆在编号为\ ...

  9. ACM International Collegiate Programming Contest World Finals 2013

    ACM International Collegiate Programming Contest World Finals 2013 A - Self-Assembly 题目描述:给出\(n\)个正方 ...

随机推荐

  1. python基础知识踩点

    1.注释 在python中,注释是以任何存在于#右侧的文字,其主要作用是写给程序读者看的笔记. 例如 单行注释 >>print("hello world") #这是一个 ...

  2. ffmpeg: error while loading shared libraries: libavdevice.so.52

    今天在编译安装ffmpeg的时候出现了题目中的问题,最终解决方案如下: errors: ffmpeg正常安装后执行ffmpeg时出现如下错误:ffmpeg: error while loading s ...

  3. codeforces C. Ilya and Matrix 解题报告

    题目链接:http://codeforces.com/problemset/problem/313/C 题目意思:给定 4n 个整数(可以组成 2n × 2n 大小的矩阵),问通过对这些整数进行排列, ...

  4. 在新建FileInputStream时使用当前相对路径或者绝对路径作为参数的问题

    今天在写一个关于配置Excel导出路径通过properties文件配置的需求,通过查询我得知  properties文件通过 FileInputStream 读取

  5. codeforces 664C C. International Olympiad(数学)

    题目链接: C. International Olympiad time limit per test 1 second memory limit per test 256 megabytes inp ...

  6. Messes in Reading Source Coding of SSD

    这里记录在学习SSD源码过程中用到的相关内容 keras.applications.imagenet_utils.preprocess_input(): 用来将读入的原始图片张量转换成为需要Image ...

  7. 洛谷 1079 Vigenère 密码——模拟水题

    题目:https://www.luogu.org/problemnew/show/P1079 大水题. #include<iostream> #include<cstdio> ...

  8. 堆栈(栈stack)的实现和基本用法(二)

    个人网站http://www.ravedonut.com/ 栈的应用: #include <iostream> #include <stack> using namespace ...

  9. 1.8-1.10 大数据仓库的数据收集架构及监控日志目录日志数据,实时抽取之hdfs系统上

    一.数据仓库架构 二.flume收集数据存储到hdfs 文档:http://flume.apache.org/releases/content/1.9.0/FlumeUserGuide.html#hd ...

  10. Flutter实战视频-移动电商-14.首页_url_launcher一键拨打店长电话

    14.首页_url_launcher一键拨打店长电话 首页拨打电话的功能. 接收连个值,一个是店长的头像,一个是电话号码, 然后开始写我们的build方法.点击图片的时候要有一个拨打电话的动作.我们要 ...