** poj Y2K Accounting Bug 2586

** poj Y2K Accounting Bug 2586

大家好,又见面了,我是全栈君,今天给大家准备了Idea注册码。

Y2K Accounting Bug
Time Limit: 1000MS   Memory Limit: 65536K
Total Submissions: 10117   Accepted: 5043

Description

Accounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual report for MS Inc.

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 s and each month when MS Inc. posted deficit, the deficit was d. 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.

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.

Input

Input is a sequence of lines, each containing two positive integers s and d.

Output

For each line of input, output one line containing either a single integer giving the amount of surplus for the entire year, or output Deficit if it is impossible.

Sample Input

59 237
375 743
200000 849694
2500000 8000000

Sample Output

116
28
300612
Deficit

Source

版权声明:本文博主原创文章,博客,未经同意不得转载。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/116872.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • 表白代码Python_自制表白神器

    表白代码Python_自制表白神器文章目录前言演示网站制作部署网站二维码制作总结前言跟着我做,不要跳着看,否则你会失败。第一步是制作二维码;第二步是制作网站。演示具体成果地址:https://yanghanwen.xyz/ai/网站制作首先你需要下载我的这个完整项目:链接:https://pan.baidu.com/s/1EmRehx_gRnT5hLjJvKuAIg提取码:pz1y–来自百度网盘超级会员V2的分享下载好后文件目录如下:然后你需要注意的是我把img里面的图片删了,涉及隐私,大家自己替换自己追

  • charles乱码怎么解决_charles乱码怎么解决

    charles乱码怎么解决_charles乱码怎么解决前言当使用Charles抓包时,发现数据都是乱码,这时需要安装证书解决办法1.点击charles窗口,点击左上角Help->SSLProxying→InstallCharles

  • 微软Office与金山WPS Office有何私密关系?「建议收藏」

    微软Office与金山WPS Office有何私密关系?

  • LTE学习之路(15)——QCI

    LTE学习之路(15)——QCIQCI表示QoS类别指示。这是一种特定标识,其定义了LTE数据包通信的质量QCI类别范围:1~9(每个类别的定义如下表所示)注意:通过‘ActivatedefaultEPSbearercon

  • Java多线程面试题(面试必备)

    文章目录一、多线程基础基础知识1.并发编程1.1并发编程的优缺点1.2并发编程的三要素1.3并发和并行有和区别1.4什么是多线程,多线程的优劣?2.线程与进程2.1什么是线程与进程2.2线程与进程的区别2.3用户线程与守护线程2.4什么是线程死锁2.5形成死锁的四个必要条件2.6如何避免死锁3.创建线程的四种方式4.线程状态和基本操作一、多线程基础基础知识1.并发编程1.1并发编程的优缺点优点:充分利用多核CPU的计算能力,通过并发编程的形式将多核CPU的计算.

  • pycharm的库安装不成功_pycharm上传github

    pycharm的库安装不成功_pycharm上传github艹,坑死我算了,应该是这个目录C:\ProgramFiles\Git\cmd\git.exe,之前我一直用的是git-bash那个,导致一直不对。

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号