1884: 三个家庭
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 244 Solved: 81
[Submit][Status][Web Board]
Description

There are three families who have a garden, each wife of three families need to help clean the garden. Mrs. A worked for five days and Mrs. B worked for four days before finishing the garden. Mis. C is pregnant so she can’t join their work.In order to thank for their work,she paid 90 yuan .The question is how to give A,B the money , how much should A get? 90 / (5 + 4) * 5 = 50 yuan ? If you think so , how stupid you are ! The correct answer is 60 yuan . Please think about it carefully.
The following answer is a general question: assuming that Mrs. A worked for x days, Mrs. B worked for y days, Mrs. C had z yuan , how much should A wife get ? Two wives get non-negative integer money. Three wives have the same work efficiency.

Input

Multiple cases , for each case:
Three positive integers x,y,z . A wife worked for x days , B wife worked for y days , and C wife paid z yuan for them .

Output

For each case ,output a interger ,the money that A wife got. We needed to do decimals to round up and round down numbers。

Sample Input

5 4 90

Sample Output

60

HINT

Source

XF
AC_code:
/*
思维题,本来三个人应该做一样多的,现在A,B帮C做了她那份,看A帮C做了多少,注意这句话: We needed to do decimals to round up and round down numbers(我们需要做小数的四舍五入)。
*/

#include <stdio.h>
int main()
{double x,y,z;while(~scanf("%lf%lf%lf",&x,&y,&z)){double aver = (x + y)/3;double A_get;x > aver?A_get = (x - aver)*z/aver:A_get = 0;printf("%.0lf\n",A_get);}return 0;
}

1884: 三个家庭(思维题)相关推荐

  1. ZOJ 3829 贪心 思维题

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3829 现场做这道题的时候,感觉是思维题.自己智商不够.不敢搞,想着队友智商 ...

  2. yoyo思维题(困难) 组合数学

    问题 B: yoyo思维题(困难) 时间限制: 1 Sec  内存限制: 256 MB 提交: 11  解决: 3 [提交][状态][讨论版][命题人:qianyouyou][Edit] [TestD ...

  3. ☆【CodeForces - 764C】Timofey and a tree (思维题,树的性质)

    题干: Each New Year Timofey and his friends cut down a tree of n vertices and bring it home. After tha ...

  4. CSP难度的经典题目/有趣的思维题选讲(一)

    引言 这里讲到的难题是一部分非常典型的题目,但并不是所有.因此这并非是一个全面的知识列表,而只适合提高组同学用来提升能力和拓展视野. 这篇文章在很多地方讲述的不够详细和严谨,因为它的作用并非是题解,而 ...

  5. codeforces 有意思的思维题 1 ~ 15

    codeforces 思维题 1.给定数组,求满足i < j and ai * aj = i + j的数对数量 2.第 i 步向前跳 i 步或后退 1 步 3.给两个点,求正方形的另两个点 4. ...

  6. little w and Soda(思维题)

    链接:https://ac.nowcoder.com/acm/contest/297/A 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言5242 ...

  7. 思维题 UVA 10881 Piotr's Ants

    题目传送门 1 /* 2 题意:在坐标轴上一群蚂蚁向左或向右爬,问经过ts后,蚂蚁的位置和状态 3 思维题:本题的关键1:蚂蚁相撞看作是对穿过去,那么只要判断谁是谁就可以了 4 关键2:蚂蚁的相对位置 ...

  8. CF--思维练习-- CodeForces - 215C - Crosses(思维题)

    ACM思维题训练集合 There is a board with a grid consisting of n rows and m columns, the rows are numbered fr ...

  9. ACM思维题训练 Section A

    题目地址: 选题为入门的Codeforce div2/div1的C题和D题. 题解: A:CF思维联系–CodeForces -214C (拓扑排序+思维+贪心) B:CF–思维练习-- CodeFo ...

最新文章

  1. hdu 1263 水果
  2. 版本变迁_一本书遍览古今中外红楼梦版本变迁
  3. 根据文件扩展名获取系统图标
  4. 斗地主AI算法——第八章の被动出牌(2)
  5. php mysql子查询,mysql子查询命令
  6. ASP.NE浏览时 无法显示 XML 页
  7. python参数类型定义_Python的参数类型
  8. 2021级计科新生C语言项目设计视频集锦
  9. 苹果怎么使用计算机,苹果系统电脑怎么用_超详细mac新手教程-win7之家
  10. 计算机控制系统信号恢复之零阶保持器
  11. JAVA 9中module初探
  12. SQL server 字符串 转 日期格式
  13. 2018,丁磊的野心静悄悄
  14. AndroidStudio利用android-support-multidex解决65536问题64k问题
  15. 【超详细】全国大学生软件测试大赛:移动应用测试参赛指南
  16. SpringDataJPA -06- specification的基本使用
  17. 去除图片水印的快速方法,操作简单看完就会!
  18. 重要!我的公众号要改名了(一些感想...)
  19. 逻辑强化(04)真假推理 答案解析
  20. 可视化-three.js波浪线条

热门文章

  1. 戴尔电脑 linux ssh,使用SSH管理Dell iDRAC远程控制卡
  2. iphonex适配游戏_Cocos Creator 适配怎么做?
  3. Elasticsearch 集群平衡配置
  4. Python 一键导出微信阅读记录和笔记,666!
  5. creo如何更改打开时显示方式_Creo4.0入门教程(3):设置工作目录和打开以及保存文件...
  6. 计算机jsp外文文献,计算机JSPweb外文翻译外文文献英文文献-20210615222802.docx-原创力文档...
  7. 从零开始数据科学与机器学习算法-逻辑回归-04
  8. 机器学习实战-逻辑回归-19
  9. 怎么在服务器上注册vbs组件,Windows下查看PC服务器硬件序列号的vbs脚本
  10. oracle undoautotune,温故知新 - UNDO,UNDO_RETENTION 及 _undo_autotune