/*
* https://p...content-available-to-author-only...r.net/problem=1
*/
#include <stdio.h>
#define SUMKI(N,K) ((K) * (N) * ((N) + 1) / 2)
#define SUMK(N,K) (SUMKI((((N) - 1) / (K)), (K)))
int main(void) {
int n = 1000;
int sum3 = SUMK(n, 3);
int sum5 = SUMK(n, 5);
int sum15 = SUMK(n , 15);
printf("%d\n", sum3
+ sum5
- sum15
);
return 0;
}
LyoKICogaHR0cHM6Ly9wLi4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5yLm5ldC9wcm9ibGVtPTEKICovCiNpbmNsdWRlIDxzdGRpby5oPgoKI2RlZmluZSBTVU1LSShOLEspICgoSykgKiAoTikgKiAoKE4pICsgMSkgLyAyKQojZGVmaW5lIFNVTUsoTixLKSAoU1VNS0koKCgoTikgLSAxKSAvIChLKSksIChLKSkpCgppbnQgbWFpbih2b2lkKSB7CglpbnQgbiA9IDEwMDA7CglpbnQgc3VtMyA9IFNVTUsobiwgMyk7CglpbnQgc3VtNSA9IFNVTUsobiwgNSk7CglpbnQgc3VtMTUgPSBTVU1LKG4gLCAxNSk7CgkKCXByaW50ZigiJWRcbiIsIHN1bTMgKyBzdW01IC0gc3VtMTUpOwoJCglyZXR1cm4gMDsKfQo=