MeetCode
Check Congruent
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Check Congruent
Easy
Computer Mathematics
Modular Arithmetic
30 views
Explanation
Complexity
Problem Statement
Print YES if a and b are congruent mod m.
Input Format
Three integers a b m.
Output Format
YES or NO.
Example
Input
14 2 12
Output
YES
Constraints
m>0
Input / Output Format
Input Format
Three integers a b m.
Output Format
YES or NO.
Constraints
m>0
Examples
Input:
14 2 12
Output:
YES
Example Solution (Public)
Computer Mathematics
Normalize both and compare (a mod m) == (b mod m).
Official Solution Code
Wrap
Copy
Normalize both and compare (a mod m) == (b mod m).
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
14 2 12
Expected Output
YES
Compile Output
Error
Output
Please
login
to submit solutions.