Official
A - Good morning Editorial by en_translator
Compare \(B\) minutes past \(A\) o’clock and \(D\) minutes past \(C\) o’clock. If \(D\) minutes past \(C\) o’clock is the earlier, print Aoki
; otherwise, that is, if they are equal or \(B\) minutes past \(A\) o’clock is the earlier, then print Takahashi
. With the fact taken into account that hours are significant than minutes, the following conditional branch will do.
- If \(A>C\), print
Takahashi
. - If \(A>C\), print
Aoki
. - If \(A=C\), print
Takahashi
if \(B\leq D\), and printAoki
if \(B>D\).
Sample code in C++:
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int a, b, c, d;
cin >> a >> b >> c >> d;
if (a < c)cout << "Takahashi" << endl;
else if (a > c)cout << "Aoki" << endl;
else {
if (b <= d)cout << "Takahashi" << endl;
else cout << "Aoki" << endl;
}
return 0;
}
Sample code in Python:
a,b,c,d= map(int, input().split())
if a < c:
print("Takahashi")
elif a > c:
print("Aoki")
else:
if b <= d:
print("Takahashi")
else:
print("Aoki")
posted:
last update: