Official

A - Vanishing Pitch Editorial by en_translator


If you are new to learning programming and do not know where to start, please try Problem A “Welcome to AtCoder” from practice contest. There you can find a sample code for each language.

The ball disappears when the ball is distant more than or equal to \(VT \, \mathrm{m}\) and less than or equal to \(VS \, \mathrm{m}\), so Aoki can hit the ball if \(D \lt VT\) or \(D \gt VS\).

Sample Code (C++)

#include <bits/stdc++.h>

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int v = ri();
	int t = ri();
	int s = ri();
	int d = ri();
	puts(d < v * t || d > v * s ? "Yes" : "No");
	
	return 0;
}

Sample Code (Python)

v, t, s, d = map(int, input().split())

print('Yes' if (d < v * t or d > v * s) else 'No')

posted:
last update: