Universal Cup Judging System

Universal Cup

時間限制: 2.0 s 記憶體限制: 512 MB 總分: 100
统计

考虑一块写有整数的板子。初始时,从 $\ell$ 到 $r$ 的每个整数(包含 $\ell$ 和 $r$)都在板上恰好出现一次。在每一步操作中,我们可以选择板上的两个数 $a$ 和 $b$,使得它们的半和 $\frac{a+b}{2}$ 是一个整数,然后擦除这两个数,并在板上写下它们的半和。

经过零次或多次操作后,我们能否使板上只剩下一个数?如果可以,板上剩下的这个数最大可能是多少?

输入格式

第一行包含两个整数 $\ell$ 和 $r$:初始时板上数字的最小值和最大值($1 \le \ell \le r \le 100$)。

输出格式

输出板上可能剩下的唯一数字的最大值。如果无法使板上只剩下一个数,输出 $-1$。

样例

样例输入 1

2 4

样例输出 1

3

说明 1

$2, 3, 4 \to 3, 3 \to 3$

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.