There are N lights above a road along the X-axis. The i-th light has Xi as its X-coordinate, and it is hung Yi above the road. The i-th light illuminates a triangular area, which is an isosceles...


There are N lights above a road along the X-axis. The i-th light has Xi as<br>its X-coordinate, and it is hung Yi above the road. The i-th light illuminates<br>a triangular area, which is an isosceles triangle and its bottom edge is on<br>the X-axis. The half of the top angle of the triangle is Zi degrees. (See the<br>below figure)<br>You have an aircraft which can fly on a fixed height. Because of some<br>unknown reasons, this aircraft can fly only under the light. Your task is to<br>find the maximum possible height for your flight from X=L to X=R.<br>The lights do not block the aircraft, e.g., the aircraft can safely fly through<br>a light. Develop a C++ program that solve the above problem, sample input<br>output is listed below.<br>i-th light<br>Yi<br>valid flight<br>road<br>Xi<br>Develop a C++ program that solve the above problem.<br>Input:<br>2 3.2 7.3<br>3.2 4.7 28<br>7.3 4.2 75<br>Output:<br>3.300759642<br>

Extracted text: There are N lights above a road along the X-axis. The i-th light has Xi as its X-coordinate, and it is hung Yi above the road. The i-th light illuminates a triangular area, which is an isosceles triangle and its bottom edge is on the X-axis. The half of the top angle of the triangle is Zi degrees. (See the below figure) You have an aircraft which can fly on a fixed height. Because of some unknown reasons, this aircraft can fly only under the light. Your task is to find the maximum possible height for your flight from X=L to X=R. The lights do not block the aircraft, e.g., the aircraft can safely fly through a light. Develop a C++ program that solve the above problem, sample input output is listed below. i-th light Yi valid flight road Xi Develop a C++ program that solve the above problem. Input: 2 3.2 7.3 3.2 4.7 28 7.3 4.2 75 Output: 3.300759642

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here