fork(3) download
  1. #include <stdio.h>
  2. int main(){
  3. int l,r;
  4. scanf("%d%d",&l,&r);
  5. long long ssh=((r-1)-(l+1))/2+1;
  6. long long s= ssh*(r+l)/2;
  7. printf ("%lld",s);
  8. return 0;
  9.  
  10. }
Success #stdin #stdout 0.01s 5272KB
stdin
1 99999
stdout
2499950000