# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1110660 | vjudge1 | Tuna (COCI17_tuna) | C++98 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
int main() {
int y, x, a, z, b, toplam = 0;
scanf("%d", &y);
scanf("%d", &x);
for (int i = 0; i < y; i++) {
scanf("%d, %d", &a, &z);
int fark = a - z;
if (fark < 0) fark = -fark;
if (fark <= x) {
toplam += (a > z) ? a : z;
}
scanf("%d", &b);
toplam += b;
}