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.|

RGB7313 - ХИЕХ

Өгөгдсөн хоёр натурал тооны хамгийн их ерөнхий хуваагчийг ол.

Input

Нэг мөрөнд хоёр натурал тоо нэг зайгаар тусгаарлагдан өгөгдөнө.

Output

ХИЕХ

Example

Input:
9 15

Output:
3

Нэмсэн:Bataa
Огноо:2013-01-11
Хугацааны хязгаарлалт: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
2022-06-10 13:29:09
#include<iostream>
using namespace std;
int main()
{
long long int n,i=0,ans=1,m;
cin>>n;
m=n;
while(true){
i++;
if(n==1) {
ans=1;
break;
}
if(n%i==0) n=n/i;
else{
ans=0;
break;
}

}
if(ans==1){
i=0;
while(m>0){
i++;
m=m/i;
}
cout<<i-1;
}
else cout<<"No";
return 0;

}khandmaa to tusa
2022-03-27 08:00:30
togs-erdene t1 and stupet

Last edit: 2022-03-27 08:01:45
2022-03-16 03:10:30
#Python :)
import math
a, b = [int(x) for x in input().split()]
print(math.gcd(a,b))
2022-01-05 14:25:16
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d %d",&a,&b);
c=a;
while(true)
{
if(a%c==0 && b%c==0) break;
c--;
}
printf("%d",c);
}
pls copy this
nodlin jiliin bodolt min baiv hahha
2021-06-16 06:52:01
#include<stdio.h>
int a,b,c;
int main()
{
scanf("%d %d",&a,&b);
for(int i=1; i<=a && i<=b; i++)
{
if (a%i==0 && b%i==0)
c = i;
}
printf("%d",c);
}
2021-04-17 17:44:17
#include<stdio.h>
int main()
{
long long a,b,i;
scanf("%lld %lld",&a,&b);
i=a;
while(true)
{
if((a%i==0 && b%i==0)) break;
i--;
}
printf("%lld",i);
return 0;
}
hi bi bn hhah
2021-02-21 16:55:38
eviklediin algorithm ashigla!
2020-12-08 13:00:25
easy peasy xD
#include <iostream>

using namespace std;

int gcd(int a, int b){
if (b == 0)
return a;
return gcd(b, a % b);

}

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

cout << gcd(a, b);
return 0;
}
2020-12-02 06:52:18
#include <iostream>
using namespace std;

int main() {
int a, b, c, counter;
cin>>a>>b;
counter=1;
while (a>=counter && b>=counter){
if (a%counter==0 && b%counter==0){
c=counter;
counter+=1;
}
else {counter+=1;}
}
cout<<c;
}
2020-11-14 18:16:17
#include<stdio.h>

int main()
{
int a, b, c;
scanf("%d %d", &a, &b);
for(int i = 1; i <= a && i <= b; i++)
{
if(a % i == 0 && b % i == 0)
c = i;
}
printf("%d", c);
}
blyti
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.