Last updated
Find valid ropeway transportation routes where altitude decreases from start point to middle point to end point.
Find valid ropeway transportation routes where altitude decreases from start point to middle point to end point.
Your dataset contains two ropeway network tables: 1. A Ropeway_Stations table with station IDs, station names, and altitude 2. A Stations table with directly connected ropeway station pairs Analyze the ropeway station network and identify valid transportation routes for moving rocks from a higher-altitude point to a lower-altitude point. Each route in the Stations table is bidirectional.
| Column | Type | Key / Notes |
|---|---|---|
| id | INTEGER | |
| name | VARCHAR(40) | |
| altitude | INTEGER |
| Column | Type | Key / Notes |
|---|---|---|
| point1 | INTEGER | |
| point2 | INTEGER |
Ropeway_Stations — 5 rows
| id | name | altitude |
|---|---|---|
| 1 | Girijesh | 1900 |
| 2 | Gandhamadhan | 2100 |
| 3 | Himadri | 1600 |
| 4 | Indrakeel | 782 |
| 5 | Nagaja | 1370 |
Stations — 5 rows
| point1 | point2 |
|---|---|
| 1 | 3 |
| 3 | 2 |
| 3 | 5 |
| 4 | 5 |
| 1 | 5 |
Ropeway Route Analysis: Which triplets of stations can be used as startpt, middlept, and endpt, where altitude decreases at every step? The route should satisfy: start point altitude > middle point altitude > end point altitude. The final result table should have startpt, middlept, and endpt columns.
Your output should look like this (partial example):
| startpt | middlept | endpt |
|---|---|---|
| Girijesh | Himadri | Nagaja |
| Gandhamadhan | Himadri | Nagaja |
| Himadri | Nagaja | Indrakeel |