Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Mocha_nb

Problemset: เลขดวง

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-13 21:57:44

#include <iostream>
using namespace std;

int main(){
    int a,b,c,res = 0;
    cin >> a >> b >> c;
    if(c <= (a-7)){
        res += c+7;
    }
    if(c%7 != ((7-b)+1)%7 && c != a){
        res += c+1;
    }
    if(c%7 != ((7-b)+2)%7 && c != 1){
        res += c-1;
    }
    if(c >= 7){
        res += c-7;
    }
    cout << res;
}