Created
June 2, 2021 01:43
-
-
Save sakapon/637de74adc35c56c3912b236687c1aa1 to your computer and use it in GitHub Desktop.
競プロ典型 90 問 / Q038
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Q038 | |
{ | |
static long[] ReadL() => Array.ConvertAll(Console.ReadLine().Split(), long.Parse); | |
static (long, long) Read2L() { var a = ReadL(); return (a[0], a[1]); } | |
static void Main() => Console.WriteLine(Solve()); | |
static object Solve() | |
{ | |
var (a, b) = Read2L(); | |
var ag = a / Gcd(a, b); | |
if (ag > long.MaxValue / b) return "Large"; | |
var l = ag * b; | |
if (l > 1000000000000000000) return "Large"; | |
return l; | |
} | |
static long Gcd(long a, long b) { for (long r; (r = a % b) > 0; a = b, b = r) ; return b; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://atcoder.jp/contests/typical90/submissions/22640284