#32399:


mashiro0913 (饅頭)

學校 : 東吳大學
編號 : 152188
來源 : [163.14.3.64]
最後登入時間 :
2024-10-04 18:59:35
e835. p2.表演座位 (Seats) -- 2019年08月TOI新手同好會 | From: [118.163.56.253] | 發表日期 : 2022-10-07 11:20

#include <stdio.h>

int main(void) {
  int seat, row, position;
  scanf("%d", &seat);
  if(seat<=2500){
    printf("1 ");
    row=seat/25+1;
    position=seat%25;
    if(seat%25==0){
      printf("%d 25", row-1);
    }
    else{
      printf("%d %d", row, position);
    }
  }
  else if(2500<seat && seat<=7500){
    printf("2 ");
    row=(seat-2500)/50+1;
    position=(seat-2500)%50;
    if(seat%50==0){
      printf("%d 50", row-1);
    }
    else{
      printf("%d %d", row, position);
    }
  }
  else{
    printf("3 ");
    row=(seat-7500)/25+1;
    position=(seat-7500)%25;
    if(seat%25==0){
      printf("%d 25", row-1);
    }
    else{
      printf("%d %d", row, position);
    }
  }
  return 0;
}

 
ZeroJudge Forum