MeetCode
Check If LCM Equals Product
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Check If LCM Equals Product
Medium
Computer Mathematics
GCD/LCM & Euclid
27 views
Explanation
Complexity
Problem Statement
Given a and b, print YES if lcm(a,b)=a*b (no overlap factors).
Input Format
Two integers a b.
Output Format
YES or NO.
Example
Input
6 35
Output
YES
Constraints
a,b>0
Input / Output Format
Input Format
Two integers a b.
Output Format
YES or NO.
Constraints
a,b>0
Examples
Input:
6 35
Output:
YES
Example Solution (Public)
Computer Mathematics
lcm=a/g*b. lcm==a*b iff gcd==1. So check gcd(a,b)==1.
Official Solution Code
Wrap
Copy
lcm=a/g*b. lcm==a*b iff gcd==1. So check gcd(a,b)==1.
Please
login
to submit solutions.
Editor
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Test Cases
Output
Submission Result
Input
6 35
Expected Output
YES
Compile Output
Error
Output
Please
login
to submit solutions.