主页
题目
状态
排名
OI排名
统计
题解
请登录
常用链接
AOJ考试平台
老赵的Gitee代码
编译原理模拟考试平台
Java技术手册
FCC网站
菜鸟网
在线工具箱
字节豆包GPT
代码可视化
力扣网
牛客网
洛谷
杭电OJ
CodeForce
隐藏编译器
Problem H: Problem A - Y2K Accounting Bug
上一题
正确率: $100.00\%$
下一题
Time Limit
$1$ 秒/Second(s)
Memory Limit
$512$ 兆字节/Megabyte(s)
提交总数
$3$
正确数量
$3$
"
裁判形式
标准裁判/Standard Judge
我的状态
尚未尝试
难度
分类标签
×
为本题添加算法分类(请不要超过5个)
当前分类(单击移除):
单击选择分类:
Description
<p></p> <p> <title></title> </p> <h2>Problem A - Y2K Accounting Bug</h2> <p>Accounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual report for MS Inc.</p> <p>All what they remember is that MS Inc. posted a surplus or a deficit each month of 1999 and each month when MS Inc. posted surplus, the amount of surplus was <em>s</em> and each month when MS Inc. posted deficit, the deficit was <em>d</em>. They do not remember which or how many months posted surplus or deficit. MS Inc., unlike other companies, posts their earnings for each consecutive 5 months during a year. ACM knows that each of these 8 postings reported a deficit but they do not know how much. The chief accountant is almost sure that MS Inc. was about to post surplus for the entire year of 1999. Almost but not quite.</p> <p>Write a program, which decides whether MS Inc. suffered a deficit during 1999, or if a surplus for 1999 was possible, what is the maximum amount of surplus that they can post.</p> <p>Input is a sequence of lines, each containing two positive integers <em>s</em> and <em>d</em>. For each line of input, output one line containing either a single integer giving the amount of surplus for the entire year, or output <tt>Deficit</tt> if it is impossible.</p>
Sample Input
复制
59 237 375 743 200000 849694 2500000 8000000
Sample Output
复制
116 28 300612 Deficit
AOJ
Please Login