Universal Cup Judging System

Universal Cup

Limite de temps : 3.0 s Limite de mémoire : 1024 MB Points totaux : 100 Hackable ✓
Statistiques

$\phi(n)$ を Euler のトーシェント関数、すなわち $[1,n]$ に含まれる $n$ と互いに素な整数の個数とする。

$r\ge\frac{5\ell}{3}$ を満たす 2 つの整数 $\ell$ と $r$ が与えられる。$\ell\le x,y\le r$ かつ $\phi(x)=\phi(y)$ を満たす相異なる 2 つの整数 $x$ と $y$ を見つけるか、そのような組が存在しないことを報告せよ。

入力

最初の行には、テストケースの個数を表す整数 $t$($1\le t\le20$)が 1 つ与えられる。

続く $t$ 行にはそれぞれ、1 つのテストケースを表す 2 つの整数 $\ell$ と $r$($1\le\ell<r\le10^{17}$)が与えられる。$r\ge\frac{5\ell}{3}$ が保証される。

出力

各テストケースについて、$\phi(x)=\phi(y)$ を満たす 2 つの整数 $x$ と $y$($\ell\le x,y\le r$、$x\ne y$)を出力せよ。そのような組が存在しない場合は -1 -1 を出力せよ。有効な組が複数存在する場合は、そのうちどれを出力してもよい。

入出力例

入力 1

5
1 3
5 10
15 30
21 50
50 100

出力 1

1 2
5 8
15 16
21 26
52 56

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.