Receipt
InterviewTime limit1sMemory limit128 MB
Given the total price of 10 books and the prices of 9 of them, find the missing book's price.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
For the new semester, Sanggeun bought 10 books. He was so eager that he bought them without checking the prices, and now he wants to find out how much each book cost.
Unfortunately, the receipt got smudged, and Sanggeun can only read the prices of 9 of the 10 books.
Given the total price of all 10 books and the prices of the 9 readable books, write a program that finds the price of the one book whose price cannot be read.
Input
The first line contains the total price of the 10 books. Each of the next 9 lines contains the price of one readable book, one per line. Each book's price is a positive integer no greater than 10,000.
Output
Print the price of the one book whose price cannot be read.