Submission
Status:
Compilation Error
Subtask/Task Score:
Score: 0
User: onlyme910
Problemset: เลขดวง
Language: cpp
Time: 0.000 second
Submitted On: 2025-10-08 20:15:35
#include <bits/stdc++.h>
using namespace std;
int main(){
int d,s,p,ans = 0;cin >> d>> s>>p;
s -= 1;
int w = (p+s)/7;
int d = (p+s)%7;
if (w != 0 && p - 7 > 0) ans += p - 7;
if (w != 4 && p + 7 <= d) ans += p + 7;
if (d != 0 && p + 1 <= d) ans += p + 1;
if (d != 1 && p - 1 > 0 ) ans += p - 1;
cout << ans;
}