Big Three Total
InterviewTime limit3sMemory limit1024 MB
Count teams whose three members each have rating at least L and whose ratings sum to at least K, then print the members of each qualifying team.
- Level
Easy3 of 10
- Topics
- Implementation, Array
- Solved
- No attempts yet
Problem
In weight training, the big three total is the sum of the weights you lift in the squat, bench press, and deadlift. But the contestants of the International Collegiate Programming Contest (ICPC), where three people form one team, measure the big three in a somewhat unusual way: they compare the members' Codeforces ratings, which express each member's skill as a number.
In the weight training world there is an unwritten rule that anyone whose big three total does not exceed 500kg cannot wear clothes of the brand 'Under Armour', and rumor has it that an 'Under Armour enforcement squad' exists to crack down on such people. Sogang ICPC Team, benchmarking this, wants to create a VIP club that a team cannot join if the sum of its three members' Codeforces ratings is less than .
Under such a condition, however, even if one of the three members has a much lower rating, all three can join the VIP club as long as the other two have high enough ratings. The club president Lim Jihwan, judging that everyone who joins the club should be above a certain level, allowed only teams whose every member's rating is at least and whose three members' ratings sum to at least to join.
Jihwan, swamped by student council work and club union work, has no time to manage the VIP club's membership. For Jihwan, find the number of applicant teams that can join the VIP club, and print the ratings of the VIP members.
Input
The first line gives the integers , , and . is the number of teams, is the club joining condition on the sum of the three members' ratings, and is the club joining condition on an individual rating. (, , )
From the second line, lines follow, one team per line, each giving integers , , that represent the ratings of the members of a team applying to the VIP club. ()
Output
On the first line, print the number of teams that can join the VIP club.
On the second line, print the ratings of the VIP members in the order they were given, separated by spaces.