Text from the official booklet. Refer to the PDF for original mathematical notation, formatting, and linked input files. Printed samples and inputs are reproduced as published.
A coding competition platform is hosting an online contest where participants answer challenging problems to demonstrate their skills. To accommodate a wide range of participants, the competition has four difficulty divisions: bronze, silver, gold, and platinum. All new participants start in the bronze division, and whenever a participant achieves a perfect score in a contest, they are promoted to the next division. It is even possible for a participant to be promoted multiple times within the same contest. The platform maintains a list of all participants and their current divisions, ensuring they start at the correct level in future contests. After the latest contest, the organizers want to publish statistics on how many participants were promoted from bronze to silver, silver to gold, and gold to platinum. However, they forgot to track promotions in real time. Fortunately, they realize that they can deduce the number of promotions based on the number of participants in each division before and after the contest. Your task is to calculate the number of promotions that occurred at each level. INPUT FORMAT: Input consists of four lines, each containing two integers in the range 0..1,000,000. The first line specifies the number of bronze participants registered before and after the contest. The second line specifies the number of silver participants before and after the contest. The third line specifies the number of gold participants before and after the contest. The last line specifies the number of platinum participants before and after the contest. OUTPUT FORMAT: Please output three lines, each containing a single integer. The first line should contain the number of participants who were promoted from bronze to silver. The second line should contain the number of participants who were promoted from silver to gold. The last line should contain the number of participants who were promoted from gold to platinum. SAMPLE INPUT: 1 2 1 1 1 1 1 2 SAMPLE OUTPUT: 1 1 1 In this example, 1 participant was registered in each division prior to the contest. At the end of the contest, 2 participants were registered in bronze and platinum. One way this could have happened is that 2 new participants joined during the contest; one was promoted all the way to platinum, and the other stayed in bronze. Input Case 1: 61313 95144 25857 1516 16124 45241 53895 75624 Case 2: 49676 130031 93368 5835 47739 52611 10012 105072