码迷,mamicode.com
首页 > 其他好文 > 详细

hdu 5974 A Simple Math Problem

时间:2017-05-02 10:07:59      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:cep   search   not   integer   大学   without   one   ann   table   

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

标签:cep   search   not   integer   大学   without   one   ann   table   

原文地址:http://www.cnblogs.com/bofengyu/p/6794497.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!