Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Some1258

Problemset: เลขดวง

Language: cpp

Time: 0.002 second

Submitted On: 2026-07-21 08:50:00

#include<bits/stdc++.h>
using namespace std;
int main(){
    int x,y,z;
    cin>>x>>y>>z;
    int column = (y-1+z-1)%7;
    //cout<<column;
    int luck=0;
    if(z-7>=1){
        luck+=z-7;
    }
    if(z+7<=x){
        luck+=z+7;
    }
    if(column>0&&z-1>=1){
        luck+=z-1;
    }
    if(column<6&&z+1<=x){
        luck+=z+1;
    }
    cout<<luck;
}