Submission
Status:
PPPPPPPPP-
Subtask/Task Score:
90/100
Score: 90
User: anonymous
Problemset: เลขดวง
Language: cpp
Time: 0.004 second
Submitted On: 2026-09-30 20:40:10
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int a,b,c,sum = 0;
cin >> a >> b >> c;
if(c > 7)sum += c - 7;
if(c+7 < a)sum += c + 7;
if((c+b-1)%7 != 1 && c > 1)sum += c-1;
if((c+b-1)%7 != 7 && c < a)sum += c+1;
cout << sum;
}