Sharing Cookies --AtCoder
2024-08-30 01:16:36
题目描述
Snuke is giving cookies to his three goats.
He has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).
Your task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.
He has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).
Your task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.
Constraints
1≤A,B≤100
Both A and B are integers.
输入
Input is given from Standard Input in the following format:
A B
A B
输出
If it is possible to give cookies so that each of the three goats can have the same number of cookies, print Possible; otherwise, print Impossible.
样例输入
4 5
样例输出
Possible
#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#define range(i,a,b) for(int i=a;i<=b;++i)
#define rerange(i,a,b) for(int i=a;i>=b;--i)
#define fill(arr,tmp) memset(arr,tmp,sizeof(arr))
using namespace std;
int n,m;
void init(){
cin>>n>>m;
}
void solve(){
cout<<((!(n%)||!(m%)||!((m+n)%))?"Possible":"Impossible")<<endl;
}
int main() {
init();
solve();
return ;
}
最新文章
- 【小错误】ORA-00265: instance recovery required, cannot set ARCHIVELOG mode
- 无法删除服务器 &#39;old_server_name&#39;,因为该服务器用作复制过程中的发布服务器。 (Microsoft SQL Server,错误: 20582)
- PHPSTORM支持dwt文件设置方法
- 2.每人自己建立一个HelloWorld项目,练习使用git的add/commit/push/pull/fetch/clone等基本命令。比较项目的新旧版本的差别。答题人:张立鹏
- 前端自动化神器LiveReload配合浏览器和less/sass使用方法
- JQuery时间轴timeline插件的学习-Lateral On-Scroll Sliding with jQuery+technotarek / timeliner
- (旧)子数涵数&#183;PS——替换颜色
- 两个一样的tomcat不能同时启动解决方法
- Python pass 语句使用示例
- Grunt 构建SeaJS
- Android核心组件 Service
- 智传播客hadoop视频学习笔记(共2天)
- 浅谈.Net和Java互相调用的三种方式
- Leetcode 实施细节 Rotate Image
- 使用canvas进行图片裁剪简单功能
- Linux:PS命令详解与使用
- Android群英传笔记——第八章:Activity与Activity调用栈分析
- 设计模式之策略模式(Strategy Pattern)
- 微信小程序下拉刷新和上拉加载的实现
- 全排列筛选(java)