eolymp
bolt
Попробуйте наш новый интерфейс для отправки задач
Задачи

Elevator

Elevator

The FCC (Factory of Cylinders of Carbon) manufactures various types of cylinders of carbon. FCC is installed on the tenth floor of a building, and uses the several building's elevators to transport the cylinders. For security, the cylinders must be transported in the upright position, and since they are heavy, at most two cylinders can be transported in a single elevator ride. The elevators have the shape of a parallelepiped and their height is always greater than the height of the cylinders. To minimize the number of elevator trips to transport the cylinders, the FCC wants, whenever possible, to put two cylinders in the elevator. The figure below illustrates, schematically (top view) a case where this is possible (a), and a case where this is not possible (b): \includegraphics{https://static.e-olymp.com/content/69/695d1a7939bf33b6fd6db42532e191db5d03bab9.jpg} As there is a very large amount of elevators and types of cylinders, FCC hired you to write a program that, given the dimensions of the elevator and of the two cylinders, determines whether it is possible to put the two cylinders in the elevator. \InputFile The input contains several test cases. The first and only line of each test case contains four integers \textbf{L}, \textbf{C}, \textbf{R_1} and \textbf{R_2}, separated by blanks, indicating the width (\textbf{1} ≤ \textbf{L} ≤ \textbf{100}) and the length (\textbf{1} ≤ \textbf{C} ≤ \textbf{100}) of the elevator and the radii of the cylinders (\textbf{1} ≤ \textbf{R_1}, \textbf{R_2} ≤ \textbf{100}). The last test case is followed by a line containing four zeros separated by blanks. \OutputFile For each test case your program should print a single line with a single character, '\textbf{S}' if you can put the two cylinders in the elevator and '\textbf{N}' otherwise.
Лимит времени 1 секунда
Лимит использования памяти 64 MiB
Входные данные #1
11 9 2 3
7 8 3 2
10 15 3 7
8 9 3 2
0 0 0 0
Выходные данные #1
S
N
N
S
Источник Maratona de Programa¸c˜ao da SBC – ACM ICPC – 2010