= 偶数求和 = http://acm.hdu.edu.cn/showproblem.php?pid=2015 {{{#!cplusplus /*written by czk*/ #include #include int main() { int n, m, i; while(scanf("%d%d", &n, &m)!=EOF) for(i = 2; i <= 2*n; i+= 2*m) if(2*n-i <= 2*(m-1)) printf("%d\n", n+i/2); else printf("%d ", i+m-1); } }}}