Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: samsenpisardmoo
Problemset: เลขดวง
Language: cpp
Time: 0.002 second
Submitted On: 2025-09-30 22:13:42
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>> a>> b>> c;
int ans=0;
if (c-7 > 0) ans+=c-7;
if (c+7 < a) ans+=c+7;
int s=b-2;
if ((c-1+s)/7 == (c+s)/7) ans+=c-1;
if ((c+1+s)/7 == (c+s)/7) ans+=c+1;
cout<< ans;
}