Complex Comparator

View as PDF

Submit solution


Points: 10 (partial)
Time limit: 1.0s
Memory limit: 32M

Authors:
Problem type
Allowed languages
Python

Problem Statement

You are given two complex number and you tell how the two numbers are related.

Suppose you have two complex numbers x = (a+bj), y = (c+dj),

  1. x > y is defined to be a > c and b > d
  2. x < y is defined to be a < c and b < d
  3. x == y is defined to be a == c and b == d
  4. x >= y is defined to be either a == c and b > d or a > c and b == d
  5. similarly for <=
  6. All other cases are considered !=

Input Specification

The first line of the input gives the number of test cases, T, T test cases follow. Each test case consists of a line. The line contains two complex numbers seperated by a space.

Limits

Memory limits: 32MB.

Time limits: 1 second.

1 \leq T \leq 100

0 \leq a,b,c,d \leq 10000

Test Set 1

Sample Case.

Test Set 2

1 \leq a,b,c,d \leq 100

Test Set 3

0 \leq a,b,c,d \leq 1000

Test Set 4

0 \leq a,b,c,d \leq 10000

Output Specification

For each test case, output one line containing Case #x: y R z, where x is the case number(starting from 1), y is the first complex number, z is the second complex number. R is the relationship between y and z

Sample Input

8
2+3j 3+4j
2+3j 2+4j
2+3j 4+2j
2+3j 2+3j
3+5j 2+3j
3+5j 2+5j
0+4j 0+4j
5 3

Sample Output

Case #1: (2+3j) < (3+4j)
Case #2: (2+3j) <= (2+4j)
Case #3: (2+3j) != (4+2j)
Case #4: (2+3j) == (2+3j)
Case #5: (3+5j) > (2+3j)
Case #6: (3+5j) >= (2+5j)
Case #7: 4j == 4j
Case #8: (5+0j) >= (3+0j)

Hint

complex if-else


Comments

There are no comments at the moment.