Mines Meal Plans

면접 대비

시간 제한1초메모리 제한2048 MB

요약
각 학생에 대해 식사 횟수 사용량을 플랜 총량에서 빼고 남은 횟수와 먼치 머니를 출력한 뒤, 네 가지 식사 선택지 중 해당하는 것을 판정한다.
난이도

쉬움10점 중 3점

유형
구현, 시뮬레이션, 수학, 문자열 매칭
정답자
아직 제출이 없습니다

문제

Students at Mines who live in the residence halls must have a meal plan. The following meal plans are available:

PlanInfo
Marble1919 meals/week, \\200$ Munch Money
Marble+1919 meals/week, \\350$ Munch Money
Quartz1414 meals/week, \\200$ Munch Money
Quartz+1414 meals/week, \\350$ Munch Money

A student can get a meal by either using one of their meals swipes, or spending some of their Munch Money. If they have used all of their meal swipes or spent all of their munch money for their meal plan, then they can no longer use that option to get a meal. Given data about the meal swipes and Munch Money used by a student, can you determine what options they have for getting a meal?

입력

The first line of input will be an integer 1≤N≤1001 \leq N \leq 100, the number of students to follow. The next NN lines will have four space-separated values: a string containing the name of the student, a string containing the name of their meal plan, an integer representing how many meal swipes they have used, and a real number with at most 22 digits after the decimal point representing how much munch money they have left.

Input Restrictions

  • The meal plan names will be one of "Marble", "Marble+", "Quartz", or "Quartz+".
  • Munch Money spent will be between 0.000.00 and the maximum amount of munch money allowed by the meal plan.
  • The number of meal swipes used will be between 00 and the maximum amount of meal swipes allowed by the plan.

Money values are guaranteed to be given with at least one digit before the decimal point, and exactly two digits after the decimal point. The whole-number part of the value will not have any unnecessary leading zeros.

출력

Output should be in the format X Y Z Custom Text where X is the student's name, Y is the student's remaining number of meal swipes, and Z is the student's remaining amount of munch money, and Custom Text is one of the following depending on which of the four scenarios have occurred:

  • Use meal swipe or munch money --- the student has meal swipes left and munch money left,
  • Use munch money --- the student has no meal swipes left, but has munch money,
  • Use meal swipe --- the student has no munch money left, but has meal swipes remaining,
  • Go to Downtown Golden! --- the student has no munch money and no meal swipes remaining.

Munch money should be printed with at least one digit before the decimal point, and exactly two digits after the decimal point. The whole-number part of the value must not have any unnecessary leading zeros.

예제2

  1. 예제 1

    입력
    3
    Ethan Marble+ 17 325.67
    Elijah Quartz 14 200.00
    Finn Quartz+ 14 167.34
    
    예상 출력
    Ethan 2 24.33 Use meal swipe or munch money
    Elijah 0 0.00 Go to Downtown Golden!
    Finn 0 182.66 Use munch money
    
  2. 예제 2

    입력
    2
    Emily Quartz 13 11.11
    Dominique Quartz 14 195.34
    
    예상 출력
    Emily 1 188.89 Use meal swipe or munch money
    Dominique 0 4.66 Use munch money