Submission
Status:
PPPP-PPPPP
Subtask/Task Score:
90/100
Score: 90
User: Mocha_nb
Problemset: เลขดวง
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-13 21:31:38
#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 && c != a){
res += c+1;
}
if(c%7 != (7-b)+2 && c != 1){
res += c-1;
}
if(c > 7){
res += c-7;
}
cout << res;
}