Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- class MainClass {
- public static void Main (string[] args) {
- var aqualunger_input = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
- var sharp_input = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
- int aq_x = aqualunger_input[0];
- int aq_y = aqualunger_input[1];
- int aq_h = aqualunger_input[2];
- int s_x = sharp_input[0];
- int s_y = sharp_input[1];
- int s_h = sharp_input[2];
- int s_v = sharp_input[3];
- Func<int, int, float> time = (s, v) => s / v;
- float time_before_x = time(Math.Abs(aq_x - s_x), s_v);
- float time_before_y = time(Math.Abs(aq_y - s_y), s_v);
- float time_before_death = time(s_h, s_v) + time_before_x + time_before_y;
- float time_to_escape = aq_h - time_before_x - time_before_y;
- float tmp = time_before_x + time_before_y;
- float new_h = aq_h - tmp;
- if (new_h >= s_h) {
- Console.WriteLine("NO");
- } else if (time_to_escape >= time_before_death) {
- Console.WriteLine("NO");
- } else {
- Console.WriteLine("YES");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement