![]() | ||||
Online Judge | Problem Set | Authors | Online Contests | User |
---|---|---|---|---|
Web Board Home Page F.A.Qs Announcement | Current Contest Past Contests Scheduled Contests Award Contest |
How much did the businessman lose Time Limit:1000MS Memory Limit:65536K
Businessmen, of course, can make much money. However, sometimes, they
would lose money in trading. For example, Jame, a businessman, brought
in some goods each cost him 40 yuan and he decided to sell at the price
of 70 yuan. Then a customer came to buy one, gave Jame 100 yuan, and of
course got back 30 yuan. You may said, "Jame earned 30 yuan." But
unfortunately, Jame found the 100 yuan from the customer was fake. What
a poor man! In this case Jame lost 70 yuan (40 (the goods price) + 30
(the money paid back to the customer)). The input consists of several
instances. Each instance contains four integers N, M, P and C, which
are all in the range [0, 50000], separated by a single space.
For one instance, output one line contains exactly one integer, which tells how much Jame lost in the trade. If Jame still earned, just output a negative integer, the absolute value of which tells the money Jame earned. Sample Input
POJ Monthly--2005.07.31, Wang Yijie |
[Submit] [Go Back] [Status] [Discuss]
All Copyright Reserved 2003-2005 Ying Fuchen,Xu Pengcheng
Any problem, Please Contact Administrator