using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BOJ2609
{
class Program
{
static void Main(string[] args)
{
var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
int n = a[0];
int n2 = a[1];
int temp = 0;
while (n2 != 0)
{
temp = n % n2;
n = n2;
n2 = temp;
if (n2 == 0)
{
Console.WriteLine(n);
break;
}
}
Console.WriteLine(n * a[0] / n * a[1] / n);
}
}
}'Algorithm > BOJ' 카테고리의 다른 글
| [BOJ] 10773 제로 (0) | 2023.01.25 |
|---|---|
| [BOJ] 4153 직각삼각형 (0) | 2023.01.25 |
| [BOJ] 10822 더하기 (0) | 2023.01.23 |
| [BOJ] 5585 거스름돈 (0) | 2023.01.17 |
| [BOJ] 11659 구간 합 구하기 4 (0) | 2023.01.16 |