Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: anonymous

Problemset: เลขดวง

Language: cpp

Time: 0.005 second

Submitted On: 2026-09-30 20:53: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 != 0 && c < a)sum += c+1;

    cout << sum;

}