[Baekjoon] 백준 2163번 Python / C

방선생·2025년 1월 15일

Baekjoon

목록 보기
8/24

백준 2163번

Python code

N, M = map(int, input().split())

#처음 자르는 횟수 + 한개식 자르는 횟수 
cnt = (N - 1) + (M - 1) * N

print(cnt)

C code

#include <stdio.h>


int main(){

  int N, M;
  scanf("%d %d", &N, &M);

  int cnt = (N - 1) + (M - 1) * N;

  printf("%d", cnt);
  
  
  return 0;
}
profile
AI & Robotics

0개의 댓글