A Simple Math Problem

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1645    Accepted Submission(s): 468

Problem Description
Given two positive integers a and b,find suitable X and Y to meet the conditions:
X+Y=a
Least Common Multiple (X, Y) =b
 
Input
Input includes multiple sets of test data.Each test data occupies one line,including two positive integers a(1≤a≤2*10^4),b(1≤b≤10^9),and their meanings are shown in the description.Contains most of the 12W test cases.
 
Output
For each set of input data,output a line of two integers,representing X, Y.If you cannot find such X and Y,output one line of "No Solution"(without quotation).
 
Sample Input
6 8 798 10780
 
Sample Output
No Solution 308 490
 
Source
 
Recommend
 
 
 

hdu 5974 A Simple Math Problem的更多相关文章

  1. HDU 5974 A Simple Math Problem 数学题

    http://acm.hdu.edu.cn/showproblem.php?pid=5974 遇到数学题真的跪.. 题目要求 X + Y = a lcm(X, Y) = b 设c = gcd(x, y ...

  2. HDU 5974 A Simple Math Problem(数论+结论)

    Problem Description Given two positive integers a and b,find suitable X and Y to meet the conditions ...

  3. hdu 5974 A Simple Math Problem(数学题)

    Problem Description Given two positive integers a and b,find suitable X and Y to meet the conditions ...

  4. HDU 5974 A Simple Math Problem (解方程)

    题意:给定a和b,求一组满足x+y=a && lcm(x, y)=b. 析:x+y = a, lcm(x, y) = b,=>x + y = a, x * y = b * k,其 ...

  5. hdu 5974 A Simple Math Problem gcd(x,y)=gcd((x+y),lcm(x,y))

    题目链接 题意 现有\[x+y=a\\lcm(x,y)=b\]找出满足条件的正整数\(x,y\). \(a\leq 2e5,b\leq 1e9,数据组数12W\). 思路 结论 \(gcd(x,y)= ...

  6. HDU - 5974 A Simple Math Problem (数论 GCD)

    题目描述: Given two positive integers a and b,find suitable X and Y to meet the conditions: X+Y=a Least ...

  7. HDU 5974 A Simple Math Problem ——(数论,大连区域赛)

    给大一的排位赛中数论的一题.好吧不会做...提供一个题解吧:http://blog.csdn.net/aozil_yang/article/details/53538854. 又学了一个新的公式..如 ...

  8. HDU 5974"A Simple Math Problem"(GCD(a,b) = GCD(a+b,ab) = 1)

    传送门 •题意 已知 $a,b$,求满足 $x+y=a\ ,\ LCM(x,y)=b$ 条件的 $x,y$: 其中,$a,b$ 为正整数,$x,y$ 为整数: •题解 关键式子:设 $a,b$ 为正整 ...

  9. [数论] hdu 5974 A Simple Math Problem (数论gcd)

    传送门 •题意 一直整数$a,b$,有 $\left\{\begin{matrix}x+y=a\\ LCM(x*y)=b \end{matrix}\right.$ 求$x,y$ •思路 解题重点:若$ ...

随机推荐

  1. 我的Android进阶之旅------>Java文件大小转换工具类 (B,KB,MB,GB,TB,PB之间的大小转换)

    Java文件大小转换工具类 (B,KB,MB,GB,TB,PB之间的大小转换) 有时候要做出如下所示的展示文件大小的效果时候,需要对文件大小进行转换,然后再进行相关的代码逻辑编写. 下面是一个Java ...

  2. django 多并发,多线程。

    参考http://blog.csdn.net/u013378306/article/details/76215982 django 原生为单线程序,当第一个请求没有完成时,第二个请求辉阻塞,知道第一个 ...

  3. Linux(3)- 用户管理、文件与目录权限、常用命令、Linux软件包管理

    一.用户管理 现代操作系统一般属于多用户的操作系统,也就是说,同一台机器可以为多个用户建立账户,一般这些用户都是为普通用户,这些普通用户能同时登录这台计算机,计算机对这些用户分配一定的资源. 普通用户 ...

  4. TouchDelegate

    TouchDelegate(Rect bounds, View delegateView) Parameters: bounds Bounds in local coordinates of the ...

  5. 学习笔记のsendRedirect &forward

    尽管HttpServletResponse.sendRedirect方法和RequestDispatcher.forward方法都可以让浏览器获得另外一个URL所指向的资源,但两者的内部运行机制有着很 ...

  6. 004-安装CentOS7后需要的操作

    1 安装EPEL源 EPEL即Extra Packages for Enterprise Linux,是基于Fedora的一个项目,为红帽系的操作系统提供额外的软件包,适用于RHEL.CentOS和S ...

  7. node.js---sails项目开发(3)

    1.为新建的sails数据库新建一个用户,首先连接数据库 mongo localhost:27017 (1)显示所有数据库   (2)切换数据库 show dbs use sails 新建一个用户 账 ...

  8. python学习之路-第四天-模块

    模块 sys模块 sys.argv:参数列表,'using_sys.py'是sys.argv[0].'we'是sys.argv[1].'are'是sys.argv[2]以及'arguments'是sy ...

  9. Ajax传地址URL编码格式

    当我们用Ajax传递路径的时候,有可能会出错,尤其是路径中有汉字的时候,传递的路径与接收的路径不同.解决方法:在传递路径的时候对路径编码,接收的时候解码存入数据库. 如: <!DOCTYPE h ...

  10. java图像加密

    0 前言 为了保护服务器的图像数据,需要用一个图像加密算法来加密服务器的图像:一开始找了一种基于混沌的图像加密算法,效果还是很理想的,是把矩阵图像上的像素点进行上下左右的混乱:后来发现加密后图像会变大 ...