출처

  • 2023 서강대학교 청정수컵 새내기 Round C번
  • 2023 서강대학교 청정수컵 청정수 Round B번
  • 2023 서강대학교 청정수컵 Open Contest C번

문제

링크

풀이

#include <iostream>
using namespace std;
 
void solve(void) {
  int n; cin >> n;
  int x, y; cin >> x >> y;
 
  if (n == 1) cout << 0;
  else cout << 4 - (x == 1 || x == n) - (y == 1 || y == n);
}
 
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
 
  solve();
  return 0;
}