| BSUIR Open XII: Student Final |
|---|
| Finished |
Hello, my name is Steve. I invite you to the open olympiad at BSUIR. Take note of the coordinates: the star is called the Sun, and the planet is the third from the star. The olympiad will be attended by $$$n$$$ teams from the entire Milky Way galaxy, and your team will be the $$$n + 1$$$-th. Oh, and don't forget to come up with a problem, as this is an open olympiad and each team must propose exactly one problem. The olympiad will take place outdoors, and yes, for solving each problem your team will receive a balloon. But remember, during the olympiad it is forbidden to communicate with other participants and leave the olympiad area, otherwise the team will be disqualified. Let the strongest win, or rather the one who solves at least one more problem than all the other teams.
Steve has given you a certain list. This list contains information about each of the $$$n$$$ teams: $$$s_i$$$ — the strength of the $$$i$$$-th team, $$$w_i$$$ — the total weight of the $$$i$$$-th team, and $$$d_i$$$ — the difficulty of the problem proposed by the $$$i$$$-th team. According to the olympiad rules, for solving a problem of difficulty $$$x$$$, the team receives a balloon with a load capacity of $$$x$$$. Each team (including yours) always solves problems whose difficulty does not exceed the team's strength. The team always solves its own problem regardless of the difficulty. If at any moment the total load capacity of the balloons exceeds the weight of the team, it will take off into the air and leave the olympiad area, which in turn leads to disqualification.
You are wondering if you can win the olympiad by proposing a problem with a positive integer difficulty.
The first line contains three integers $$$n$$$, $$$s_0$$$, and $$$w_0$$$ — the number of teams, the strength, and the weight of your team, respectively.
The next $$$n$$$ lines each contain three integers $$$s_i$$$, $$$w_i$$$, and $$$d_i$$$ — the strength and weight of the $$$i$$$-th team, and difficulty of the problem proposed by the $$$i$$$-th team.
$$$$$$1 \le n \le 10^5$$$$$$ $$$$$$1 \le s_0, s_i \le 10^5$$$$$$ $$$$$$1 \le w_0, w_i \le 10^9$$$$$$ $$$$$$1 \le d_i \le 10^5$$$$$$
In a single line, output "Yes" if your team can win the olympiad. Otherwise, output "No".
2 1 2010 29 2025 59 30
Yes
3 5 2010 29 2025 69 301 50 49
No
| Name |
|---|


