Under construction

Still being built. Things may change

The ABC Conjecture

Time limit1sMemory limit1024 MB

Summary
For each range [L, H], list every coprime equation a + b = c whose radical d of a·b·c is smaller than c, sorted by c then a.
Level

Easy3 of 10

Topics
Brute force, Number theory, Math
Solved
No attempts yet

Problem

As taken from Wikipedia:

The abc conjecture (also known as the Oesterlé-Masser conjecture) is a conjecture in number theory, first proposed by Joseph Oesterlé (1988) and David Masser (1985). It is stated in terms of three positive integers, aa, bb and cc (hence the name) that are relatively prime and satisfy a+b=ca + b = c. If dd denotes the product of the distinct prime factors of a⋅b⋅ca \cdot b \cdot c, the conjecture essentially states that dd is usually not much smaller than cc. In other words: if aa and bb are composed from large powers of primes, then cc is usually not divisible by large powers of primes.

The abc conjecture is well known for the many interesting consequences it entails. Many famous conjectures and theorems in number theory would follow immediately from it. Goldfeld (1996) described the abc conjecture as "the most important unsolved problem in Diophantine analysis."

Several solutions have been proposed. The most recent one is still being evaluated by the mathematical community.

To simplify the rules:

  • aa, bb, and cc are positive integers.
  • aa, bb, and cc are composed of distinct prime factors.

To illustrate the terms, let a=16=24a = 16 = 2^4, b=17b = 17, and c=16+17=33=3⋅11c = 16 + 17 = 33 = 3 \cdot 11. Then d=2⋅17⋅3⋅11=1122d = 2 \cdot 17 \cdot 3 \cdot 11 = 1122, which is greater than cc.

The goal of this problem is to find the exceptions where c>dc > d, within a given range for aa, bb, and cc.

Input

The first line of input contains NN (0<N<1000 < N < 100), the number of test cases.

Each of the following NN lines contains two integers LL and HH (2≤L≤H≤50002 \le L \le H \le 5000), the lower and upper bounds of aa, bb, and cc. The constraints are L≤a,b<c≤HL \le a, b < c \le H, and a≠ba \ne b.

Output

For each test case, output one of the following:

  • A line "a+b=ca + b = c" for each equation that satisfies the criteria above. Sort the lines in ascending order by cc, and then in ascending order by aa when several equations share the same cc.
  • A line "No exceptions" if no equation satisfies the criteria.

Each test case is followed by a blank line.

Examples1

  1. Example 1

    Input
    2
    5 120
    6 80
    
    Expected output
    5 + 27 = 32
    27 + 5 = 32
    32 + 49 = 81
    49 + 32 = 81
    
    No exceptions