hdu 1001(分治求解)
#include <cstdio>
#include <iostream>
using namespace std;
int solve(int l, int r) {
if (l == r) return l;
return solve(l, ((l+r)>>1)) + solve(((l+r)>>1)+1, r);
}
int main() {
int n;
while (scanf("%d", &n) != EOF) {
int ans = solve(1, n);
printf ("%d\n\n", ans);
}
return 0;
}