//hdoj2015
#include<stdio.h>
int main() {
int n, m;
while(scanf("%d%d", &n, &m)!=EOF) {
int sum = 0;
for(int i = 1; i <= n; i++) {
sum += 2*i;
if(i%m == 0) {
printf(i>m?" %d":"%d", sum/m);
sum = 0;
}
}
if(sum) {
printf(n/m>0?" %d":"%d",sum/(n%m));
}
printf("\n");
}
return 0;
}
//hdoj2016
#include<stdio.h>
int a[10000];
int main() {
int n;
while(scanf("%d", &n)!=EOF && n) {
int _min = (1<<31)-1, k = -1;
for(int i = 0; i < n; i++) {
scanf("%d", &a[i]);
if(a[i] < _min) {
_min = a[i];
k = i;
}
}
int temp = a[0];
a[0] = a[k];
a[k] = temp;
for(int i = 0; i < n; i++) {
printf(i?" %d":"%d", a[i]);
}
printf("\n");
}
return 0;
}
//hdoj2017
#include<stdio.h>
#include<string.h>
char a[10000];
int main() {
int n;
while(scanf("%d", &n)!=EOF) {
while(n--) {
scanf("%s", a);
int len = strlen(a);
int num = 0;
for(int i = 0; i < len; i++) {
if(a[i] >= 48 && a[i] <= 57) num++;
}
printf("%d\n", num);
}
}
return 0;
}