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
2021-05-04 10:21:59

2021-03-09 14:14:07
// #include<bits/stdc++.h>
// using namespace std;

// int main(){
// int a, b;
// cin >> a >> b;

// while(a > 0){
// if(a < b) swap(a, b);
// cout << b << " " << a/b << endl;
// a %= b;
// }

// return 0;
// }
2021-03-05 12:00:17


Last edit: 2021-03-09 14:14:16
2020-11-12 13:45:16
inttei bolq bsna long longtoi bolj bn shu
2020-09-04 10:36:01
#include<bits/stdc++.h>
using namespace std;

#define pb push_back

int main(){
int a, b, c, i , tmp;
cin >> a >> b;
while(a > 0){
if(a < b) swap(a, b);
cout << b << " " << a/b << endl;
a%=b;
}

return 0;
}
Naranbilegin bodolt suga humuusl huuldag


Last edit: 2020-09-04 10:36:27
2020-08-13 09:04:33


















































































































































































































































































































































































































































































.
























































































.











































































































































































































































































































































.































































































.




























































































































2020-08-13 09:04:19


















































































































































































































































































































































































































































































.
























































































.











































































































































































































































































































































.































































































.




























































































































2020-07-19 14:33:50
public class Problem70 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int l = sc.nextInt();
int w = sc.nextInt();
cutRectangle(l, w);

}

private static void cutRectangle(int l, int w) {
int squere = l * w;
int k = 0;
if (l > w) {
for (int i = w; i >= 1; i--) {
if (squere >= (i * i)) {
k = squere / (i * i);
squere = squere - (k * i * i);
System.out.println(i + " " + k);
}

}

} else
for (int i = l; i >= 1; i--) {
if (squere >= (i * i)) {
k = squere / (i * i);
squere = squere - (k * i * i);
System.out.println(i + " " + k);
}

}

}
}
yu aldaatai bgag sain oilgohgvil bn.mdeh hvn bnu.
2020-06-20 08:01:48


















































































































































































































































































































































































































































































.
























































































.











































































































































































































































































































































.































































































.





























































































































2020-06-12 17:11:54


Last edit: 2020-06-16 13:37:54
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.