Hi thinker,

Try this input and outputs. Good luck.

Input :-

Code: Select all

```
42 18
35 1
20 25
29 9
13 15
6 46
32 28
12 42
46 43
28 37
42 5
3 4
43 33
22 17
19 46
48 27
22 39
20 13
18 50
36 45
0 0
```

Your output :-

Code: Select all

```
Between 42 and 18, 27 generates the longest sequence of 111 values.
Between 35 and 1, 1 generates the longest sequence of 111 values.
Between 20 and 25, 20 generates the longest sequence of 111 values.
Between 29 and 9, 9 generates the longest sequence of 111 values.
Between 13 and 15, 13 generates the longest sequence of 111 values.
Between 6 and 46, 6 generates the longest sequence of 111 values.
Between 32 and 28, 28 generates the longest sequence of 111 values.
Between 12 and 42, 12 generates the longest sequence of 111 values.
Between 46 and 43, 43 generates the longest sequence of 111 values.
Between 28 and 37, 28 generates the longest sequence of 111 values.
Between 42 and 5, 5 generates the longest sequence of 111 values.
Between 3 and 4, 3 generates the longest sequence of 111 values.
Between 43 and 33, 33 generates the longest sequence of 111 values.
Between 22 and 17, 17 generates the longest sequence of 111 values.
Between 19 and 46, 19 generates the longest sequence of 111 values.
Between 48 and 27, 27 generates the longest sequence of 111 values.
Between 22 and 39, 22 generates the longest sequence of 111 values.
Between 20 and 13, 13 generates the longest sequence of 111 values.
Between 18 and 50, 18 generates the longest sequence of 111 values.
Between 36 and 45, 36 generates the longest sequence of 111 values.
```

My Accepted program gives :-

Code: Select all

```
Between 18 and 42, 27 generates the longest sequence of 111 values.
Between 1 and 35, 27 generates the longest sequence of 111 values.
Between 20 and 25, 25 generates the longest sequence of 23 values.
Between 9 and 29, 27 generates the longest sequence of 111 values.
Between 13 and 15, 14 generates the longest sequence of 17 values.
Between 6 and 46, 27 generates the longest sequence of 111 values.
Between 28 and 32, 31 generates the longest sequence of 106 values.
Between 12 and 42, 27 generates the longest sequence of 111 values.
Between 43 and 46, 43 generates the longest sequence of 29 values.
Between 28 and 37, 31 generates the longest sequence of 106 values.
Between 5 and 42, 27 generates the longest sequence of 111 values.
Between 3 and 4, 3 generates the longest sequence of 7 values.
Between 33 and 43, 41 generates the longest sequence of 109 values.
Between 17 and 22, 18 generates the longest sequence of 20 values.
Between 19 and 46, 27 generates the longest sequence of 111 values.
Between 27 and 48, 27 generates the longest sequence of 111 values.
Between 22 and 39, 27 generates the longest sequence of 111 values.
Between 13 and 20, 18 generates the longest sequence of 20 values.
Between 18 and 50, 27 generates the longest sequence of 111 values.
Between 36 and 45, 41 generates the longest sequence of 109 values.
```

I think u get it .

Some Love Stories Live Forever ....