#CCBCHBON0000030. Tìm cặp (i,j) đầu tiên (First Pair with Given Sum)

Tìm cặp (i,j) đầu tiên (First Pair with Given Sum)

First Pair with Given Sum

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Consider pairs 1<=i<j<=n in lexicographic order (i increasing, then j increasing). Print the first pair whose sum is k, or -1 if absent. An equal-index pair is invalid.

Input

One line: n,kn,k; 1≤n≤10001\le n\le1000, 2≤k≤2n2\le k\le2n.

Output

Print i j separated by a space, or -1.

Subtasks

  • Subtask 1 (20%): 1≤n≤151\le n\le 15; 2≤k≤2n2\le k\le2n.

  • Subtask 2 (30%): 1≤n≤1001\le n\le 100; 2≤k≤2n2\le k\le2n.

  • Subtask 3 (50%): 1≤n≤10001\le n\le 1000; 2≤k≤2n2\le k\le2n.

Examples

Example 1

Input:

5 6

Output:

1 5

Explanation:

The first pair in lexicographic order meeting i<j and i+j=k is printed; otherwise -1. Result: 1 5.

Example 2

Input:

3 2

Output:

-1

Explanation:

The first pair in lexicographic order meeting i<j and i+j=k is printed; otherwise -1. Result: -1.

Example 3

Input:

1 2

Output:

-1

Explanation:

The first pair in lexicographic order meeting i<j and i+j=k is printed; otherwise -1. Result: -1.