Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7317 - Цөөн квадрат

Өгөгдсөн тэгш өнцөгтийг хамгийн цөөн квадратадуудад хуваа.  

Input

2 бүхэл эерэг тоо зайгаар тусгаарлагдан өгөгдөнө.

Output

Мөр тус бүрт квадратын талын хэмжээ хэдэн ширхэг байгааг зайгаар тусгаарлан хэвлэнэ.

Example

Input 1:

11 4

Output:

3 1
1 3

 

4 2

3 1

1 3

 


Нэмсэн:Bataa
Огноо:2013-01-14
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2024-04-05 05:58:30
bilguun haana yvaan
2024-04-05 05:58:29
гомо болдоо
2024-04-05 05:57:56
ene tshilgaan hoyriin huuhdud dandaa huulna
2024-04-05 05:56:45


Last edit: 2024-04-05 05:58:06
2024-01-21 11:31:12
uguulberee oilgdgu shsn
2024-01-16 06:20:39
#include <bits/stdc++.h>
using namespace std;
int main (){
int a, b;
cin >> a >> b;
while ( a > 0 and b > 0 ) {
if ( a > b ) {
cout << b << " " << a/b << endl;
a = a % b;
}else {
cout << a << " " << b/a << endl;
b = b % a;
}
}

return 0;
}

2023-12-27 17:17:21
public class Think {
public static void main (String[] args) throws java.lang.Exception
{
Scanner in = new Scanner(System.in);
int a=in.nextInt();
int b=in.nextInt();
int c=0;
if(a>b){
c=a;
a=b;
b=c;
}

while(a!=0){ // 4!=0 true
System.out.println(a+ " "+b/a); // 4

c=a;
a=b%a;
b=c;
}
}
}
2023-11-27 08:06:44
#include<bits/stdc++.h>
using namespace std;
main(){
int a, b, n, d, c;
cin>>a>>b;
if(a>b){
c=a;
a=b;
b=c;
}
while(a!=0){
cout<<a<<" "<<b/a<<endl;
c=a;
a=b%a;
b=c;
}
}
ts
2023-11-15 10:39:24
#include<bits/stdc++.h>
using namespace std;
main(){
int a, b, n, d, c;
cin>>a>>b;
if(a>b){
c=a;
a=b;
b=c;
}
while(a!=0){
cout<<a<<" "<<b/a<<endl;
c=a;
a=b%a;
b=c;
}
}
2023-08-20 03:24:56
#include <iostream>
#include <algorithm>
using namespace std;
int n,m;
int main()
{
cin>>n>>m;
while(n>0)
{
if (n<m) swap(n,m);
cout<<m<<" "<<n/m<<endl;
n=n%m;
}
return 0;
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.