#include <iostream>
#include <algorithm>
#include <vector> using namespace std; int main(){
int n,k,l,r,s_n,s_k;
cin >> n >> k >> l >> r >> s_n >> s_k;
int s_n_k = s_n-s_k;
int average_k = s_k/k,left_k = s_k%k;
vector<int> a(n,);
for(int i = ; i < k ; ++ i ){
a[i] = average_k;
if(i < left_k) a[i]+=;
}
if(s_n_k){ //注意n和k相等的情况
int average_n_k = s_n_k / (n-k), left_n_k = s_n_k%(n-k);
for(int i = k ; i < n; ++ i){
a[i] = average_n_k;
if(i - k < left_n_k) a[i] +=;
}
}
cout<<a[];
for(int i = ; i < n ; ++ i) cout<<" "<<a[i];
cout<<endl;
return ;
}

Codeforces Round #216 (Div. 2) B. Valera and Contest的更多相关文章

  1. Codeforces Round #216 (Div. 2) D. Valera and Fools

    题目链接:http://codeforces.com/contest/369/problem/D 注意题意:所有fools都向编号最小的fool开枪:但每个fool都不会笨到想自己开枪,所以编号最小的 ...

  2. Codeforces Round #216 (Div. 2)A. Valera and Plates

    #include <iostream> using namespace std; int main(){ int n, m , k; cin >> n >> m & ...

  3. Codeforces Round #216 (Div. 2) E. Valera and Queries 树状数组 离线处理

    题意:n个线段[Li, Ri], m次询问, 每次询问由cnt个点组成,输出包含cnt个点中任意一个点的线段的总数. 由于是无修改的,所以我们首先应该往离线上想, 不过我是没想出来. 首先反着做,先求 ...

  4. Codeforces Round #216 (Div. 2) E. Valera and Queries (BIT)

    标题效果: 给很多分布 x 行轴. 然后给出了一个非常的多点集,问该组点分布多少不同段. IDEAS: 分散成多个线段点集的. 给出的线段的话,也就是说这个点集上不会有点在这条线段上. 所以我们就是求 ...

  5. 水题 Codeforces Round #307 (Div. 2) A. GukiZ and Contest

    题目传送门 /* 水题:开个结构体,rk记录排名,相同的值有相同的排名 */ #include <cstdio> #include <cstring> #include < ...

  6. Codeforces Round #216 (Div. 2)

    以后争取补题不看别人代码,只看思路,今天就是只看思路补完的题,有点小激动. A. Valera and Plates 水题,贪心地先放完第一种食物,在考虑第二种. 居然被卡了一会,心态要蹦 :(: # ...

  7. Codeforces Round #252 (Div. 2) B. Valera and Fruits(模拟)

    B. Valera and Fruits time limit per test 1 second memory limit per test 256 megabytes input standard ...

  8. Codeforces Round #216 (Div. 2)解题报告

    又范低级错误! 只做了两题!一道还被HACK了,囧! A:看了很久!应该是到语文题: 代码:#include<iostream> #include<];    ,m2=;    ;i ...

  9. [Codeforces Round #237 (Div. 2)] A. Valera and X

    A. Valera and X time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

随机推荐

  1. zip 压缩文件 unzip查看zip压缩包内的内容

    [root@GitLab tmp]# zip -r new.zip ./*  adding: gitlab_key_file20161001-2668-1eu44mv (deflated 15%)  ...

  2. EF – 1.模式

      3种数据库 code first model first database first       创建EF http://www.cnblogs.com/tangge/p/3834578.htm ...

  3. 学习SQLAlchemy Core

    有时间了就要慢慢看,死守DJANGO ORM,明显没有SQLAlchemy有优势. 因为SQLAlchemy针对整个PYTHON都是有用的. 找了本书,慢慢撸. <Essential.SQLAl ...

  4. JVM_Bind:8080 的解决办法【131031】

    出错情况:运行 Tomcat 时报错 含义:8080 位置显示的端口被其他进程占用 解决方法: 方法1: 开始--运行--cmd 进入命令提示符 输入netstat -ano 即可看到所有连接的PID ...

  5. Oracle里SID、SERVICE_NAME

    本文仅用作备忘,无实际指导意义,逻辑略混乱. 1.命令show parameter name; SQL> show parameter name; NAME TYPE VALUE ------- ...

  6. css 全局 兼容性问题

    css 笔记 第一种:常用的全局CSS属性设置 //参考大型网站,如凤凰网 (1)清除所有的标记的内外边距 body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,p ...

  7. android 入门-Service

    sdk 1.7 package com.example.hellowrold; import java.util.Random; import com.example.hellowrold.R.id; ...

  8. wp8 入门到精通 Animation 背景加字体颜色从下向上变化颜色效果

    <phone:PhoneApplicationPage.Resources> <Style x:Key="ButtonStyle1" TargetType=&qu ...

  9. Request和Response对象

    Request 和 Response 对象起到了服务器与客户机之间的信息传递作用.Request 对象用于接收客户端浏览器提交的数据,而 Response 对象的功能则是将服务器端的数据发送到客户端浏 ...

  10. Android中log使用方法

    private static final String ACTIVITY_TAG="MainActivity"; Log.v(MainActivity.ACTIVITY_TAG, ...