s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1 value | original_language stringclasses 11 values | filename_ext stringclasses 1 value | status stringclasses 1 value | cpu_time int64 0 100 | memory stringlengths 4 6 | code_size int64 15 14.7k | code stringlengths 15 14.7k | problem_id stringlengths 6 6 | problem_description stringlengths 358 9.83k | input stringlengths 2 4.87k | output stringclasses 807 values | __index_level_0__ int64 1.1k 1.22M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s708741787 | p00005 | u412088763 | 1592125867 | Python | Python3 | py | Accepted | 20 | 5664 | 167 | import math
while True:
try:
a,b=(map(int,input().split()))
x=math.gcd(a,b)
y=a*b//x
print(x,y)
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,902 |
s208089588 | p00005 | u245861861 | 1591496591 | Python | Python3 | py | Accepted | 20 | 5668 | 232 | import math
john=[]
while True:
try:
john.append(input())
except EOFError:
break
for i in john:
k=list(map(int,i.split()))
print(int(math.gcd(k[0],k[1])),int(k[0]*k[1]/math.gcd(k[0],k[1])))
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,903 |
s781442127 | p00005 | u214512859 | 1591010714 | Python | Python3 | py | Accepted | 20 | 5660 | 230 | import math
import sys
def gcd(a,b):
if b==0:
return a
return gcd(b, a%b)
def lcm(a,b):
return a/gcd(a,b)*b
for l in sys.stdin:
a=list(map(int,l.split()))
print("%d %d"%(gcd(a[0],a[1]),lcm(a[0],a[1])))
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,904 |
s481888515 | p00005 | u591478797 | 1590505765 | Python | Python3 | py | Accepted | 20 | 5600 | 350 | def gcd(a:int, b:int):
if b == 0:
return a
return gcd(b,a%b)
def main():
while 1:
try:
a = list(map(int, input().split()))
b = gcd(a[0],a[1])
c = a[0]/b*a[1]
print('%s %d' % (b,c))
except:
break
if __name__ == "__main__":
main()
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,905 |
s973611338 | p00005 | u742234621 | 1590473009 | Python | Python3 | py | Accepted | 30 | 5600 | 338 | def gcd(a, b):
if b == 0:
return a
return gcd(b,a%b)
def main():
while 1:
try:
a = list(map(int, input().split()))
b = gcd(a[0],a[1])
c = a[0]/b*a[1]
#d = [b,c]
print('%d %d' % (b,c))
except:
break
main()
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,906 |
s966428351 | p00005 | u959565708 | 1590471972 | Python | Python3 | py | Accepted | 20 | 5600 | 307 | def GCD(a,b):
if(b==0):
return a
return GCD(b,a%b)
def LCM(a,b):
return a / GCD(a,b) * b
while True:
try:
x = list(map(int,input().split()))
ans_1 = GCD(x[0],x[1])
ans_2 = LCM(x[0],x[1])
print("%d %d"%(ans_1,ans_2))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,907 |
s504402503 | p00005 | u707206451 | 1590471950 | Python | Python3 | py | Accepted | 20 | 5600 | 210 | def gcd(a,b):
if(b==0):
return a
return gcd(b,a%b)
while True:
try:
a,b = map(int, input().split())
g = gcd(a,b)
print("%s %d"%(g,a/g*b))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,908 |
s150991875 | p00005 | u842461513 | 1588910916 | Python | Python3 | py | Accepted | 20 | 5656 | 344 | #mathモジュールをインポートする
import math
try:
while True:
a,b = map(int,input().split())
#最小公約数
num1 = math.gcd(a,b)
#最大公倍数
num2 = int(a * b / num1)
print(str(num1) + " " + str(num2))
#EOFErrorをひろいコードを終了する
except EOFError:
pass
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,909 |
s611132349 | p00005 | u260980560 | 1588728212 | Python | Python3 | py | Accepted | 20 | 5600 | 211 | def gcd(m, n):
while n:
m, n = n, m % n
return m
def lcm(m, n):
return m // gcd(m, n) * n
for line in open(0).readlines():
a, b = map(int, line.split())
print(gcd(a, b), lcm(a, b))
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,910 |
s792515919 | p00005 | u095087680 | 1588493143 | Python | Python3 | py | Accepted | 30 | 5660 | 162 | import math
while True:
try:
a, b = map(int, input().split())
print(math.gcd(a, b), int((a * b) / math.gcd(a, b)))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,911 |
s692669585 | p00005 | u235330043 | 1588085262 | Python | Python3 | py | Accepted | 20 | 5660 | 202 | import math
while True:
try :
a,b = map(int,input().split())
gcd = math.gcd(a,b)
c= a/gcd
d= b/gcd
print(gcd,int(c*d*gcd))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,912 |
s105697610 | p00005 | u374434600 | 1586623912 | Python | Python3 | py | Accepted | 20 | 5652 | 283 | import sys
import math
def gcd(x,y):
if(x%y==0):
return y
else:
return(gcd(y,x%y))
try:
while True:
a,b= map(int, input().split())
max1=gcd(a,b)
min1=(a*b)//gcd(a,b)
print(str(max1)+' '+str(min1))
except EOFError:
pass
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,913 |
s496228180 | p00005 | u713674793 | 1586598631 | Python | Python3 | py | Accepted | 20 | 5656 | 177 | import math
while True:
try:
a,b = map(int,input().split())
x = math.gcd(a,b)
y = a * b // x
print(x,y)
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,914 |
s603801780 | p00005 | u230927103 | 1586361364 | Python | Python3 | py | Accepted | 20 | 5592 | 245 | def gcd(aa, bb):
if aa % bb == 0:
return bb
return gcd(bb, aa % bb)
import sys
for line in sys.stdin.readlines():
ab = list(map(int, line.split()))
a = max(ab)
b = min(ab)
g = gcd(a, b)
print(g, a * b // g)
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,915 |
s094845574 | p00005 | u630911389 | 1585576698 | Python | Python3 | py | Accepted | 20 | 5600 | 228 | def gcd(x,y):
return gcd(y,x % y) if y > 0 else x
def lcm(a, b):
return ((a*b) // gcd(a,b))
while(1):
try:
x,y = (int(x) for x in input().split())
print(gcd(x,y),lcm(x,y))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,916 |
s072382201 | p00005 | u490578380 | 1584689117 | Python | Python3 | py | Accepted | 20 | 5664 | 194 | import math
while True:
try:
a, b = list(map(int, input().split()))
print('{0} {1}'.format(math.gcd(a, b), int(a * b / math.gcd(a, b))))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,917 |
s775642961 | p00005 | u123017074 | 1584577165 | Python | Python3 | py | Accepted | 20 | 5660 | 186 | import math
try:
while True:
a, b = list(map(int, input().split()))
print("{} {}".format(math.gcd(a, b), (a * b) // math.gcd(a, b)))
except Exception as _:
pass
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,918 |
s381103112 | p00005 | u808372529 | 1583731999 | Python | Python3 | py | Accepted | 20 | 5664 | 211 | import math
while True:
try:
a = list(map(int,input().split()))
b = (math.gcd(a[0],a[1]))
c = ((a[0]*a[1])//math.gcd(a[0],a[1]))
print(b,c)
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,919 |
s995750402 | p00005 | u642972715 | 1582170439 | Python | Python3 | py | Accepted | 20 | 5656 | 150 | import math
try:
while True:
a, b= map(int, input().split())
print(math.gcd(a, b),(a*b)//math.gcd(a,b))
except EOFError:
pass
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,920 |
s603997992 | p00005 | u747586296 | 1581051257 | Python | Python3 | py | Accepted | 20 | 5608 | 366 | # 最大公約数:ユークリッドの互除法
import sys
def gcd(x, y):
return y if not x%y else gcd(y, x%y)
def get_input():
data = []
for line in sys.stdin:
a, b = [int(i) for i in line.split()]
data.append((a,b))
return data
data = get_input()
for x,y in data:
GCD = gcd(x,y)
LCM = x*y // GCD
print(GCD, LCM)
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,921 |
s447663239 | p00005 | u237184581 | 1581051052 | Python | Python3 | py | Accepted | 20 | 5624 | 257 | import sys
sys.setrecursionlimit(10**7)
import fileinput
def gcd(a, b):
while b:
a, b = b, a % b
return a
def lcm(a, b):
return a * b // gcd(a, b)
for line in sys.stdin:
x, y = map(int, line.split())
print(gcd(x,y),lcm(x,y))
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,922 |
s704124462 | p00005 | u194673654 | 1581050758 | Python | Python3 | py | Accepted | 20 | 5636 | 315 | import fileinput
def GCD(x, y):
if y != 0:
return GCD(y, x % y)
else:
return x
for line in fileinput.input():
x, y = [int(s) for s in line.split()]
#print("{} {}".format(GCD(x, y), int(x * y/GCD(x, y))))#別にformatでなくてもいい
print(GCD(x, y),int(x * y/GCD(x, y)))
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,923 |
s498589410 | p00005 | u153447291 | 1577532124 | Python | Python3 | py | Accepted | 40 | 6956 | 159 | import fractions
while True:
try:
a,b = map(int,input().split())
except:
break
print(fractions.gcd(a,b),a*b // fractions.gcd(a,b))
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,924 |
s680831117 | p00005 | u236679854 | 1577435033 | Python | Python3 | py | Accepted | 20 | 5664 | 152 | from math import gcd
while True:
try:
a, b = map(int, input().split())
print(gcd(a, b), a*b//gcd(a, b))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,925 |
s273813341 | p00005 | u813197825 | 1577374225 | Python | Python3 | py | Accepted | 20 | 5600 | 253 | def GCD(a, b):
if b == 0:
return a
return GCD(b, a % b)
def LCM(a, b):
return a * b // GCD(a, b)
import sys
s = sys.stdin.readlines()
n = len(s)
for i in range(n):
x, y = map(int, s[i].split())
print(GCD(x, y), LCM(x, y))
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,926 |
s123233868 | p00005 | u297517978 | 1573380240 | Python | Python3 | py | Accepted | 20 | 5664 | 142 | import math
while 1:
try:
a,b,=map(int,input().split())
print(math.gcd(a,b),a*b//math.gcd(a,b))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,927 |
s841793575 | p00005 | u933957884 | 1572688634 | Python | Python3 | py | Accepted | 20 | 5676 | 159 | import sys;import math;print("\n".join(["{} {}".format(math.gcd(a,b), a // math.gcd(a,b) * b) for x in sys.stdin for a, b in [[int(y) for y in x.split()]] ]))
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,928 |
s208190190 | p00005 | u803862921 | 1570846639 | Python | Python3 | py | Accepted | 20 | 5664 | 174 | import math
while True:
try:
a, b = [int(x) for x in input().split()]
print(math.gcd(a,b), a*b // math.gcd(a,b))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,929 |
s138814992 | p00005 | u824708460 | 1566136788 | Python | Python3 | py | Accepted | 20 | 5660 | 154 | import math
while 1:
try:
a, b = map(int, input().split())
g = math.gcd(a, b)
print(g, int(a*b/g))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,930 |
s687148219 | p00005 | u595265835 | 1565512612 | Python | Python3 | py | Accepted | 20 | 5660 | 174 | import math
while True:
try:
a, b = map(int , input().split())
print(math.gcd(a, b), a // math.gcd(a, b) * b)
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,931 |
s447233164 | p00005 | u445425884 | 1564925281 | Python | Python3 | py | Accepted | 20 | 5664 | 141 | import math
while True:
try:
a,b=list(map(int,input().split()))
print(math.gcd(a,b),a*b//math.gcd(a,b))
except:break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,932 |
s320299434 | p00005 | u455877373 | 1564924680 | Python | Python3 | py | Accepted | 20 | 5596 | 198 | while True:
try:
( a, b ) = map ( int, input ( ).split ( ) )
except EOFError: break
( x, y ) = ( a, b )
while x != 0:
( x, y ) = ( y % x, x )
print ( "%s %s" % ( y, a * b // y ) )
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,933 |
s258870122 | p00005 | u218784088 | 1564919388 | Python | Python3 | py | Accepted | 20 | 5660 | 149 | import math
while True:
try:
a,b = map(int,input().split())
print(math.gcd(a,b),a*b//math.gcd(a,b))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,934 |
s323134862 | p00005 | u586792237 | 1564918823 | Python | Python3 | py | Accepted | 20 | 5664 | 148 | import math
while True:
try:
a,b = map(int,input().split())
print(math.gcd(a,b),a*b//math.gcd(a,b))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,935 |
s249273390 | p00005 | u821561321 | 1564843651 | Python | Python3 | py | Accepted | 20 | 5600 | 230 | def lcm(a,b):
return a//gcd(a,b)*b
def gcd(a,b):
while b != 0:
r=a%b
a=b
b=r
return a
while True:
try:
a=list(map(int,input().split()))
print(gcd(a[0],a[1]),lcm(a[0],a[1]))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,936 |
s890243849 | p00005 | u607723579 | 1564814345 | Python | Python3 | py | Accepted | 20 | 5600 | 289 | def lcm(a, b):
return a // gcd(a, b) * b
def gcd(a, b):
while b != 0:
r = a % b
a = b
b = r
return a
while True:
try:
a = list(map(int, input().split()))
print(gcd(a[0], a[1]), lcm(a[0], a[1]))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,937 |
s198460339 | p00005 | u433250944 | 1564682185 | Python | Python3 | py | Accepted | 20 | 5660 | 148 | import math
while True:
try:
a,b = map(int,input().split())
print(math.gcd(a,b),a*b//math.gcd(a,b))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,938 |
s581718966 | p00005 | u525395303 | 1564626396 | Python | Python3 | py | Accepted | 30 | 5596 | 339 | # AOJ 0005 GCD and LCM
# Python3 2018.6.9 bal4u
def lcm(a, b):
return a // gcd(a, b) * b
def gcd(a, b):
while b != 0:
r = a % b
a = b
b = r
return a
while True:
try:
a = list(map(int, input().split()))
print(gcd(a[0], a[1]), lcm(a[0], a[1]))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,939 |
s402569826 | p00005 | u804558166 | 1564585267 | Python | Python3 | py | Accepted | 20 | 5592 | 208 | while(True):
try:
(a, b) = map(int, input().split(" "))
(x, y) = (a, b)
while (x != 0):
(x, y) = (y%x, x)
print("%s %s" %(y, a*b//y))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,940 |
s944382251 | p00005 | u212392281 | 1564581085 | Python | Python3 | py | Accepted | 20 | 5656 | 147 | import math
try:
while(True):
a, b = map(int, input().split())
print(math.gcd(a, b), a * b // math.gcd(a, b))
except:
pass
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,941 |
s759002531 | p00005 | u678843586 | 1563939643 | Python | Python3 | py | Accepted | 40 | 6956 | 144 | import fractions
while 1:
try:
a,b=map(int,input().split())
c=fractions.gcd(a,b)
print(c,(a*b)//c)
except:break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,942 |
s602363158 | p00005 | u013648252 | 1563678545 | Python | Python3 | py | Accepted | 40 | 6956 | 144 | import fractions
while 1:
try:
a,b=map(int,input().split())
c=fractions.gcd(a,b)
print(c,(a*b)//c)
except:break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,943 |
s668924151 | p00005 | u397862444 | 1563166223 | Python | Python3 | py | Accepted | 20 | 5600 | 261 | def lcm(a, b):
return a // gcd(a, b) * b
def gcd(a, b):
while b != 0:
r = a % b
a = b
b = r
return a
while True:
try:
a = list(map(int, input().split()))
print(gcd(a[0], a[1]), lcm(a[0], a[1]))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,944 |
s020764248 | p00005 | u427219397 | 1562565081 | Python | Python3 | py | Accepted | 20 | 5592 | 211 | def gcd(a, b):
while b:
a, b = b, a % b
return a
while True:
try:
a,b = map(int,input().split())
print (gcd(a,b),a *b // gcd(a,b))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,945 |
s733218065 | p00005 | u037441960 | 1562563068 | Python | Python3 | py | Accepted | 20 | 5660 | 188 | import math
while True :
try :
a, b = map(int, input().split())
Gcd = math.gcd(a, b)
Lcm = (a * b) // Gcd
print(Gcd, Lcm)
except :
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,946 |
s407315505 | p00005 | u997476941 | 1562562968 | Python | Python3 | py | Accepted | 20 | 5604 | 260 | def lcm(a, b):
return a // gcd(a, b) * b
def gcd(a, b):
while b != 0:
r = a % b
a = b
b = r
return a
while True:
try:
a = list(map(int, input().split()))
print(gcd(a[0], a[1]), lcm(a[0], a[1]))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,947 |
s861640367 | p00005 | u051789695 | 1562042514 | Python | Python3 | py | Accepted | 20 | 5600 | 222 | def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
def lcm(a,b):
return (a*b)//gcd(a,b)
while True:
try:
a,b=map(int,input().split())
except:
break
print(gcd(a,b),lcm(a,b))
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,948 |
s413173167 | p00005 | u313600138 | 1561965363 | Python | Python3 | py | Accepted | 20 | 5660 | 148 | import math
while True:
try:
a,b =map(int,input().split())
c =math.gcd(a,b)
d =a*b// math.gcd(a,b)
print(c,d)
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,949 |
s051680952 | p00005 | u108130680 | 1561959078 | Python | Python3 | py | Accepted | 20 | 5656 | 130 | import math
while 1 :
try:
a,b=map(int,input().split())
c=math.gcd(a,b)
print(c, (a*b)//c)
except:break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,950 |
s572817308 | p00005 | u264450287 | 1560749968 | Python | Python3 | py | Accepted | 20 | 5596 | 246 | while True:
try:
a,b=map(int,input().split())
if a<b:
a,b=b,a
s=b
r=a%s
while True:
if r==0:
G=s
break
else:
s,r=r,s%r
L=int((a*b)/G)
print(G,L)
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,951 |
s659859904 | p00005 | u614095715 | 1560528105 | Python | Python3 | py | Accepted | 20 | 5672 | 150 | import math
import sys
for line in sys.stdin.readlines():
a, b = list(map(int, line.split()))
print(f'{math.gcd(a,b)} {a*b//math.gcd(a,b)}')
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,952 |
s351463665 | p00005 | u548252256 | 1560103440 | Python | Python3 | py | Accepted | 20 | 5660 | 152 | import math
import sys
if __name__ == '__main__':
for line in sys.stdin:
a,b = map(int,line.split())
print(math.gcd(a,b),(a*b) // math.gcd(a,b))
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,953 |
s887935434 | p00005 | u814278309 | 1559653999 | Python | Python3 | py | Accepted | 20 | 5664 | 170 | import math
while True:
try:
a,b=map(int,input().split())
def lcm(x,y):
return (x*y)//math.gcd(x,y)
print(math.gcd(a,b),lcm(a,b))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,954 |
s380461319 | p00005 | u506537276 | 1558332889 | Python | Python3 | py | Accepted | 20 | 5592 | 214 | def solve(a, b):
if a % b == 0:
return b
else:
return solve(b, a % b)
while True:
try:
a, b = map(int, input().split())
lcm = solve(a,b)
print(lcm, a * b // lcm)
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,955 |
s239868919 | p00005 | u146816547 | 1557559859 | Python | Python3 | py | Accepted | 20 | 5596 | 246 | def gcd(x, y):
while y != 0:
x, y = y, x % y
return x
def lcm(x, y):
return x//gcd(x, y)*y
while True:
try:
a, b = map(int, input().split())
print(gcd(a, b), lcm(a, b))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,956 |
s905318674 | p00005 | u314166831 | 1557331393 | Python | Python3 | py | Accepted | 20 | 5620 | 1,152 | ###
### atcorder test program
###
import sys
### math class
class math:
### pi
pi = 3.14159265358979323846264338
### GCD
def gcd(self, a, b):
if b == 0:
return a
return self.gcd(b, a%b)
### LCM
def lcm(self, a, b):
return (a*b)//self.gcd(a,b)
math = math()
### output class
class output:
### list
def list(self, l):
l = list(l)
print(" ", end="")
for i, num in enumerate(l):
print(num, end="")
if i != len(l)-1:
print(" ", end="")
print()
output = output()
### input sample
#i = input()
#A, B, C = [x for x in input().split()]
#inlist = [int(w) for w in input().split()]
#R = float(input())
#A = [int(x) for x in input().split()]
#for line in sys.stdin.readlines():
# a, b = map(int, line.split())
### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")
for line in sys.stdin.readlines():
x, y = [int(temp) for temp in line.split()]
print("{} {}".format(math.gcd(x,y), math.lcm(x,y)))
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,957 |
s198120407 | p00005 | u904226154 | 1557214003 | Python | Python3 | py | Accepted | 30 | 5660 | 182 | import math
while True:
try:
x, y = map(int, input().split())
print(str(math.gcd(x,y)) + " " + str((x * y) // math.gcd(x, y)))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,958 |
s330484998 | p00005 | u406093358 | 1555462641 | Python | Python | py | Accepted | 10 | 4632 | 232 | import sys
def euclid(x, y):
if y == 0: return x
elif x < y: return euclid(y, x)
else: return euclid(y, x%y)
for line in sys.stdin:
a, b = map(int, line.split())
gcd = euclid(a, b)
lcm = a*b/gcd
print str(gcd)+' '+str(lcm)
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,959 |
s980017434 | p00005 | u647694976 | 1554618167 | Python | Python3 | py | Accepted | 20 | 5656 | 163 | import math
while True:
try:
a,b=map(int,input().split())
gcd=math.gcd(a,b)
lcm=int(a*b/gcd)
print(gcd, lcm)
except:break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,960 |
s306727527 | p00005 | u761923615 | 1554427820 | Python | Python3 | py | Accepted | 20 | 5664 | 141 | import math
while True:
try:
a,b=list(map(int,input().split()))
x=math.gcd(a,b)
y=int(a*b/x)
print("%d %d"%(x,y))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,961 |
s291187945 | p00005 | u625806423 | 1552922327 | Python | Python3 | py | Accepted | 30 | 5592 | 294 | while True:
try:
m,n = map(int, input().split())
except EOFError:
break
LCM = m * n
if m < n:
m,n = n,m
# calculating GCD
while True:
if m % n == 0:
GCD = n
break
else:
m, n = n, m % n
# calculating LCM
LCM = LCM // GCD
print(GCD,LCM)
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,962 |
s739472071 | p00005 | u990228206 | 1551163000 | Python | Python3 | py | Accepted | 20 | 5660 | 141 | import math
while True:
try:
a,b=list(map(int,input().split()))
print(math.gcd(a,b),a*b//math.gcd(a,b))
except:break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,963 |
s662861194 | p00005 | u195186080 | 1550730291 | Python | Python3 | py | Accepted | 20 | 5596 | 471 | def GCD(x, y):
# 最大公約数
if x < y:
x, y = y, x
while True:
r = x % y
if r == 0:
return y
x, y = y, r
def calc_DCD_LCM(x, y):
# 最大公約数
gcd = GCD(x, y)
# 最小公倍数
lcm = int(x*y/gcd)
return(gcd, lcm)
while True:
try:
x, y = list(map(int, input().split()))
gcd, lcm = calc_DCD_LCM(x, y)
print('{0} {1}'.format(gcd, lcm))
except:
exit(0)
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,964 |
s971730318 | p00005 | u733798831 | 1550493151 | Python | Python3 | py | Accepted | 20 | 5596 | 297 | def GCD(a,b):
S=[a,b]
S.sort(reverse=True)
while S[1]>0:
S2=[S[1],S[0]%S[1]]
S=S2
return S[0]
try:
while True:
a,b=[int(i) for i in input().split(" ")]
G=GCD(a,b)
L=int(a*b/G)
print("%d %d"%(G,L))
except EOFError:
pass
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,965 |
s550670417 | p00005 | u158979022 | 1547103778 | Python | Python3 | py | Accepted | 20 | 5656 | 140 | import math
while True:
try:
a, b = map(int, input().split())
print(math.gcd(a, b), a * b // math.gcd(a, b))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,966 |
s527071363 | p00005 | u689047545 | 1547015035 | Python | Python3 | py | Accepted | 30 | 5668 | 277 | import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
if __name__ == '__main__':
while True:
try:
a, b = map(int, input().split())
print('{0} {1}'.format(math.gcd(a, b), lcm(a, b)))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,967 |
s669811975 | p00005 | u498511622 | 1544313700 | Python | Python3 | py | Accepted | 20 | 5596 | 246 | def gcd(x,y):
while y:
x, y = y, x % y
return x
def lcm(x,y):
return x * y // gcd(x,y)
while True:
try:
a = list(map(int,input().split()))
print(gcd(a[0],a[1]),lcm(a[0],a[1]))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,968 |
s702837226 | p00005 | u080014366 | 1543761506 | Python | Python3 | py | Accepted | 20 | 5600 | 300 | while True:
try:
n=list(map(int, input().split()))#ファイルの読み込み --.py <--.txt
except EOFError:
break
if n[0]>n[1]:#なくてもいいなあ
l=n[0]
s=n[1]
else:
l=n[1]
s=n[0]
a=l
b=s
r=a%b
while r!=0:
a=b
b=r
r=a%b
GCD=int(b)
LCM=int(l*s/b)
print(GCD, LCM)
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,969 |
s744438032 | p00005 | u291570764 | 1543494378 | Python | Python3 | py | Accepted | 20 | 5592 | 212 | def GCD(a, b):
while b!=0:
tmp=b
b=a%b
a=tmp
return a
while True:
try:
a, b = map(int, input().split())
except EOFError:
break
a, b = (a, b) if a>=b else (b, a)
gcd=GCD(a,b)
print(gcd, a*b//gcd)
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,970 |
s307057652 | p00005 | u573115711 | 1543222102 | Python | Python3 | py | Accepted | 20 | 5600 | 251 | import sys
def findGCD(a, b):
if b == 0:
return a
return findGCD(b, a%b)
if __name__ == "__main__":
for line in sys.stdin:
a, b = [int(i) for i in line.strip().split(" ")]
GCD = findGCD(a,b)
LCM = a*b//GCD
print(GCD, LCM)
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,971 |
s368623859 | p00005 | u606639970 | 1543027398 | Python | Python3 | py | Accepted | 20 | 5668 | 210 | import sys
import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
for line in sys.stdin:
a, b = [int(x) for x in line.split()]
c = math.gcd(a, b)
d = lcm(a, b)
print("%d %d" % (c, d) )
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,972 |
s902363486 | p00005 | u067299340 | 1542078932 | Python | Python3 | py | Accepted | 20 | 5604 | 223 | while True:
try:
a, b = [int(x) for x in input().split()]
n, m = [min(a, b), max(a, b)]
while n != 0:
n, m = m % n, n
print(m, a * b // m)
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,973 |
s469559638 | p00005 | u717526540 | 1541579461 | Python | Python3 | py | Accepted | 20 | 5600 | 331 | while(1):
try:
a, b = map(int, input().split())
except:
break
x = max(a, b)
y = min(a, b)
if x % y == 0:
gcd = y
else:
while x % y != 0:
z = x % y
x = y
y = z
else:
gcd = z
lcm = a * b // gcd
print(gcd, lcm)
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,974 |
s013241943 | p00005 | u317583692 | 1539618182 | Python | Python3 | py | Accepted | 20 | 5604 | 300 | def gcd(x,y):
q = max(x,y) % min(x,y)
if q == 0 :
return min(x,y)
return round(gcd(min(x,y),q))
def lcm(a, b):
return round(a*b / gcd(a, b))
while True:
try:
a, b = map(int,input().split())
print(gcd(a,b),lcm(a,b))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,975 |
s412391984 | p00005 | u219940997 | 1537191351 | Python | Python3 | py | Accepted | 20 | 5664 | 211 | import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
while True:
try:
a, b = map(int, input().split())
print('{} {}'.format(math.gcd(a, b), lcm(a, b)))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,976 |
s126346480 | p00005 | u316584871 | 1537080343 | Python | Python3 | py | Accepted | 20 | 5596 | 319 | while True:
try:
a,b = map(int, input().split())
nlist = sorted([a,b])
while True:
c = nlist[1]%nlist[0]
nlist = [c, nlist[0]]
if (c == 0):
break
ss = nlist[1]
print(ss, int(a*b/ss))
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,977 |
s579849822 | p00005 | u923573620 | 1536226146 | Python | Python3 | py | Accepted | 20 | 5664 | 213 | import math
while True:
try:
a, b = map(int, input().split(" "))
print(math.gcd(max(a, b), min(a, b)), int(max(a, b) * min(a, b) / math.gcd(max(a, b), min(a, b))))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,978 |
s051374049 | p00005 | u319725914 | 1533910750 | Python | Python3 | py | Accepted | 20 | 5664 | 156 | import math
while(True):
try:
a,b = map(int, input().split())
c = math.gcd(a,b)
print(c, int(a*b/c))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,979 |
s452217305 | p00005 | u248155947 | 1533544632 | Python | Python | py | Accepted | 10 | 4644 | 291 | # coding:utf-8
import sys
# 最大公約数
def gcd(a, b):
while b > 0:
a, b = b, a%b
return a
# 最小公倍数
def lcm(a, b):
return a*b/gcd(a, b)
for s in sys.stdin:
a, b = map(int,s.split())
gcd_num = gcd(a, b)
lcm_num = lcm(a, b)
print "%d %d"%(gcd_num, lcm_num)
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,980 |
s315427357 | p00005 | u938878704 | 1533104656 | Python | Python3 | py | Accepted | 20 | 5592 | 399 | ans = []
def gcd(a, b) :
if a % b == 0 :
return b
else :
return gcd(b, a % b)
def lcm(a, b) :
return a * b // gcd(a, b)
while True :
try :
s = input()
a, b = map(int, s.split())
m_gcd, m_lcm = gcd(a, b), lcm(a, b)
ans.append([m_gcd, m_lcm])
except :
for a in ans :
print(a[0], a[1])
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,981 |
s322632596 | p00005 | u841567836 | 1532779360 | Python | Python3 | py | Accepted | 20 | 5592 | 327 | def gcd(x, y):
if x < y:
x, y = y, x
return x if y == 0 else gcd(y, x % y)
def run():
while True:
try:
x, y = map(int, input().split())
g = gcd(x, y)
l = x * y // g
print(g, l)
except:
break
if __name__ == '__main__':
run()
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,982 |
s450018711 | p00005 | u252700163 | 1532664521 | Python | Python3 | py | Accepted | 40 | 6956 | 153 | from fractions import gcd
while True:
try:
a, b = map(int, input().split())
left = gcd(a,b)
print( left, a*b//(left))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,983 |
s009127861 | p00005 | u930302179 | 1532257119 | Python | Python3 | py | Accepted | 20 | 5660 | 103 | import sys,math
for e in sys.stdin:
a,b=map(int, e.split())
d=a*b
a = math.gcd(a,b)
print(a, d//a)
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,984 |
s994526640 | p00005 | u853158149 | 1521963963 | Python | Python3 | py | Accepted | 20 | 5596 | 247 | def gcd(a, b):
if a == 0:
return b
else:
return gcd(b%a, a)
def lcm(a, b):
return a*b//gcd(a, b)
while 1:
try:
a,b = map(int, input().split(" "))
print(gcd(a, b),lcm(a, b))
except:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,985 |
s676681314 | p00005 | u079141094 | 1467250321 | Python | Python3 | py | Accepted | 30 | 7584 | 209 | def gcd(a,b):
if b < 1: return a
a,b = b,a % b
return gcd(a,b)
ss = input().split()
while ss:
a,b = map(int,ss)
g = gcd(a,b)
l = int(a*b/g)
print(g,l)
try: ss = input().split()
except EOFError: break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,986 |
s970919693 | p00005 | u197615660 | 1372319344 | Python | Python | py | Accepted | 10 | 4224 | 226 | while True:
try:
data = map(int, raw_input().split())
[a, b] = data
m = a
n = b
while m % n != 0:
hoge = m % n
m = n
n = hoge
gcm = n
lcm = a * b / gcm
print gcm, lcm
except EOFError:
break
| p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
</p>
<h2>Constraints</h2>
<ul>
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
<li> The number of data sets ≤ 50</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print GCD and LCM separated by a single space in a line.
</p>
<H2>Sample Input</H2>
<pre>
8 6
50000000 30000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
2 24
10000000 150000000
</pre>
| 8 6
50000000 30000000
| 2 24
10000000 150000000
| 3,987 |
s207412650 | p00006 | u539753516 | 1531569893 | Python | Python3 | py | Accepted | 20 | 5544 | 21 | print(input()[::-1])
| p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,988 |
s138251117 | p00006 | u896746547 | 1531810901 | Python | Python3 | py | Accepted | 20 | 5544 | 37 | s = input().rstrip()
print(s[::-1])
| p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,989 |
s553583886 | p00006 | u563075864 | 1531895215 | Python | Python3 | py | Accepted | 20 | 5548 | 34 | a = input()
b = a[::-1]
print(b)
| p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,990 |
s789134150 | p00006 | u525366883 | 1535421253 | Python | Python | py | Accepted | 10 | 4608 | 24 | print raw_input()[::-1]
| p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,991 |
s944901856 | p00006 | u011621222 | 1545238422 | Python | Python3 | py | Accepted | 20 | 5560 | 166 |
def reverseString(s):
return s[::-1]
while True:
try:
s = str(input())
s = reverseString(s)
print(s)
except:
break
| p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,992 |
s903194115 | p00006 | u179046735 | 1555896476 | Python | Python3 | py | Accepted | 20 | 5540 | 21 | print(input()[::-1])
| p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,993 |
s946605776 | p00006 | u814278309 | 1559139376 | Python | Python3 | py | Accepted | 20 | 5544 | 29 | str=input()
print(str[::-1])
| p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,994 |
s040764027 | p00006 | u340991036 | 1559540761 | Python | Python3 | py | Accepted | 20 | 5544 | 22 | print(input()[::-1])
| p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,995 |
s637950764 | p00006 | u804558166 | 1559541113 | Python | Python3 | py | Accepted | 20 | 5544 | 27 | s = input()
print(s[::-1])
| p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,996 |
s703888402 | p00006 | u114860785 | 1559541740 | Python | Python3 | py | Accepted | 20 | 5548 | 21 | print(input()[::-1])
| p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,997 |
s307387437 | p00006 | u063179562 | 1406767606 | Python | Python3 | py | Accepted | 30 | 6720 | 20 | print(input()[::-1]) | p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,998 |
s428521627 | p00006 | u450407555 | 1409273616 | Python | Python | py | Accepted | 10 | 4176 | 23 | print raw_input()[::-1] | p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 3,999 |
s389647649 | p00006 | u696166817 | 1409414191 | Python | Python3 | py | Accepted | 30 | 6720 | 345 | if __name__ == "__main__":
while True:
try:
#a, b = sorted(map(int, input().strip("\n").split(" ")), reverse=True)
#str = input()
#rts = str[::-1]
#print(str)
#print(rts)
print(input()[::-1])
except EOFError:
break # escape from while loop | p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 4,000 |
s940827386 | p00006 | u579833671 | 1410765049 | Python | Python | py | Accepted | 10 | 4188 | 30 | s = raw_input()
print(s[::-1]) | p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>Output for the Sample Input</H2>
<pre>
admin23w
</pre>
| w32nimda
| admin23w
| 4,001 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.