#32399: 寫超爛


mashiro0913 (高碩辰)

School : 格致中學
ID : 152188
IP address : [118.163.56.253]
Last Login :
2022-12-23 11:05:06
e835. p2.表演座位 (Seats) -- 2019年08月TOI新手同好會 | From: [118.163.56.253] | Post Date : 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