CodeForces 633A之Ebony and Ivory
来源:互联网 发布:华为网络盒子怎么样 编辑:程序博客网 时间:2024/05/16 19:42
Description
Dante is engaged in a fight with "The Savior". Before he can fight it with his sword, he needs to break its shields. He has two guns, Ebony and Ivory, each of them is able to perform any non-negative number of shots.
For every bullet that hits the shield, Ebony deals a units of damage while Ivory deals b units of damage. In order to break the shield Dante has to deal exactlyc units of damage. Find out if this is possible.
Input
The first line of the input contains three integers a, b, c (1 ≤ a, b ≤ 100, 1 ≤ c ≤ 10 000) — the number of units of damage dealt by Ebony gun and Ivory gun, and the total number of damage required to break the shield, respectively.
Output
Print "Yes" (without quotes) if Dante can deal exactly c damage to the shield and "No" (without quotes) otherwise.
Sample Input
4 6 15
No
3 2 7
Yes
6 11 6
Yes
分析:输入三个数a,b,c;判断i*a+j*b==c是否成立,是输出YES,否则输出NO
AC代码如下:
- CodeForces 633A之Ebony and Ivory
- Codeforces 633A Ebony and Ivory 【水题】
- CodeForces 633A-Ebony and Ivory
- 633A.Ebony and Ivory
- CodeForces 633 A.Ebony and Ivory(水~)
- A. Ebony and Ivory
- Manthan, Codefest 16 -A Ebony and Ivory
- CodeForces Manthan, Codefest 16 A Ebony and Ivory 扩展欧几里德(其实暴力直接搞就可以)
- 【Manthan, Codefest 16A】【水题 暴力】Ebony and Ivory ax+by=z
- codeforces 839A 之 Arya and Bran
- codeforces 862A 之 Mahmoud and Ehab and the MEX
- 数学 之 Codeforces 354A - Vasya and Robot
- codeforces A. Ciel and Robot
- codeforces --A - Sereja and Algorithm
- codeforces A. Vanya and Cards
- 【CODEFORCES】 A. Pashmak and Garden
- 【CodeForces】A. Mike and Frog
- codeforces A. Ilya and Diplomas
- Android实现EditText输入金额
- linux 使用qq 这个qq2015更新的
- 每日一得--jvm虚拟机优化
- javascript针对DOM的应用(二)
- Opencv图像识别从零到精通(14)-----线性滤波和非线性滤波
- CodeForces 633A之Ebony and Ivory
- hdu4385(状态压缩dp)
- 习题16 读写文件
- QT:关闭外部程序
- Key Set hd 5363
- SDUT 2136 数据结构实验之二叉树的建立与遍历
- android studio中如何导入github项目
- HPU 4883 TIANKENG’s restaurant
- android studio Dagger2的使用(环境搭建和helloword)