Compare Fractions a/b and c/d

Compare Fractions a/b and c/d

Hard Computer Mathematics Integers & Divisibility 37 views
Explanation Complexity

Problem Statement

Compare two fractions without floating point. Print , or =.

Input Format

Four integers a b c d.

Output Format

One char: < or > or =.

Example

1 3 2 6
=

Constraints

b,d != 0, values fit in 64-bit

Input / Output Format

Input Format
Four integers a b c d.
Output Format
One char: < or > or =.
Constraints
b,d != 0, values fit in 64-bit

Examples

Input:
1 3 2 6
Output:
=

Example Solution (Public)

Computer Mathematics
Compare a*d and c*b using integer multiplication. If a*d < c*b print < etc.

Official Solution Code

Compare a*d and c*b using integer multiplication. If a*d < c*b print < etc.
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.