GCD Of Two Numbers

Easy
4 views 25 Jan 2026
Compute gcd(a,b)....

LCM Of Two Numbers

Easy
3 views 25 Jan 2026
Compute lcm(a,b)....

GCD Of Array

Medium
4 views 25 Jan 2026
Given n and n integers, print gcd of all numbers....

LCM Of Array Small

Hard
2 views 25 Jan 2026
Given n...

Are Coprime

Easy
3 views 25 Jan 2026
Print YES if gcd(a,b)=1....

Simplify Fraction

Medium
2 views 25 Jan 2026
Given a/b, reduce it to lowest terms and keep sign in numerator....

GCD Of Differences

Hard
3 views 25 Jan 2026
Given n numbers, print gcd of all |ai-a1|....

Extended Euclid Coefficients

Hard
3 views 25 Jan 2026
Find x,y such that ax+by=gcd(a,b). Print gcd x y....

Mod Inverse When Coprime

Hard
2 views 25 Jan 2026
Given a and m, print inverse of a mod m, or -1 if not exists....

LCM Using Prime Exponents

Hard
2 views 25 Jan 2026
Given two numbers ...

GCD Queries Prefix Suffix

Hard
3 views 25 Jan 2026
Given array and q queries [l,r], output gcd of all except between l..r....

Check If LCM Equals Product

Medium
3 views 25 Jan 2026
Given a and b, print YES if lcm(a,b)=a*b (no overlap factors)....

Count Coprime With N (Small)

Hard
2 views 25 Jan 2026
Given n...