WORK #2

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
250 B
3
Indexable
Never
#include <iostream>
using namespace std;

int main() {
    int N, R, C;
    cin >> N >> R >> C;
    
    int attackCount = min(R-1, C-1) + min(N-R, N-C) + min(N-R, C-1) + min(R-1, N-C);
    cout << attackCount << endl;
    
    return 0;
}