fork download
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main(){
  4. long long n;
  5. int x=pow(10,9)+7;
  6. scanf("%lld",&n);
  7. long long a=(n+1)*(n+2)/2;
  8. long long b = a%x;
  9. printf("%lld",b);
  10. }
Success #stdin #stdout 0s 5512KB
stdin
10
stdout
66