#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; int n,m; int flag1,flag2; void dfs(int a,int b,int x)
{
if(b==)
{
flag2=;
if(a==) flag1=;
}
if(flag1&&flag2) return;
if(x==) return; if(a%x==) dfs(a/x,b,x-);
if(b%x==) dfs(a,b/x,x-);
dfs(a,b,x-);
} int main()
{
while(~scanf("%d%d",&n,&m))
{
if(n<m) swap(n,m);
flag1=,flag2=;
dfs(n,m,);
if(flag1==&&flag2==) printf("%d\n",m);
else printf("%d\n",n);
}
return ;
}

最新文章

  1. OC中copy的使用
  2. 设置SecureCRT配色和解决乱码问题
  3. C++ 检测内存泄露工具 -- Windows平台
  4. 【转】IOS开发资源汇总
  5. SQL Server 2008 R2——VC++ ADO 操作 存储过程
  6. 第五节:什么导致Finalize方法被调用
  7. UIButton的简单操作和实际应用
  8. 配置Windows 2008 R2 64位 Odoo 8.0/9.0 源码开发调试环境
  9. PHP 7 新特性
  10. SQL Server-常用分页语句
  11. Sysbench&#160;Sysbench在centos系统下的安装
  12. XML解析技术-dom4j
  13. Lepus监控之Oracle配置
  14. 一文学redis操作(记录向)
  15. linux中断源码分析 - 中断发生(三)
  16. windows IOCP入门的一些资料
  17. powerdesigner远程连接数据库
  18. .net写本地文件的一个方法
  19. [转帖] 大神 Linus Torvalds 语录
  20. layui框架遇到时间控件在搜索之后再次点击出现异常的问题

热门文章

  1. Tomcat v7.0 Server at localhost are already in use,tomcat提示端口被占用,tomcat端口已经被使用,tomcat端口占用
  2. IDEA导入maven项目的步骤
  3. nodejs,http,get,post,请求
  4. Linux 下安裝 MyEclipse
  5. InnoDB引擎数据存放位置
  6. 130道C#面试题
  7. MATLAB &#39; : &#39; 官方解释
  8. [MFC美化] Skin++使用详解-使用方法及注意事项
  9. MQTT协议之 Apache Apollo服务
  10. NGINX----源码阅读---sources配置脚本