#abc243a. A - Shampoo
A - Shampoo
Score : points
问题陈述
在高桥家中共有三个人居住:高桥、他的父亲和母亲。他们每个人每晚都在浴室洗头。
按照顺序,他的父亲、母亲和高桥依次洗澡,并分别使用 、 和 毫升的洗发水。
今天早上,洗发水瓶中装有 毫升的洗发水。如果不进行补充,谁会是第一个洗发水用完而无法洗头的人?
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Three people live in Takahashi's house: Takahashi, his father, and his mother. All of them wash their hair in the bathroom each night.
His father, his mother, and Takahashi take a bath in this order and use , , and milliliters of shampoo, respectively.
This morning, the bottle contained milliliters of shampoo. Without refilling, who will be the first to run short of shampoo to wash their hair?
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If the first person to run short of shampoo to wash their hair is Takahashi's father, print F
; if it is Takahashi's mother, print M
; if it is Takahashi, print T
.
Sample Input 1
25 10 11 12
Sample Output 1
T
Now, they have milliliters of shampoo.
- First, Takahashi's father uses milliliters, leaving .
- Next, Takahashi's mother uses milliliters, leaving .
- Finally, Takahashi tries to use milliliters and runs short of shampoo since only is remaining.
Sample Input 2
30 10 10 10
Sample Output 2
F
Now, they have milliliters of shampoo.
- First, Takahashi's father uses milliliters, leaving .
- Next, Takahashi's mother uses milliliters, leaving .
- Then, Takahashi uses milliliters, leaving .
- Next day, Takahashi's father tries to use milliliters and runs short of shampoo since only is remaining.
Sample Input 3
100000 1 1 1
Sample Output 3
M
update @ 2024/3/10 10:26:26
相关
在以下作业中: