Codeforces Round 868 (Div. 2)
E
Removing Graph
Codeforces
2500
原题
← DF →
翻译中…

Alice and Bob are playing a game on a graph. They have an undirected graph without self-loops and multiple edges. All vertices of the graph have degree equal to $2$. The graph may consist of several components. Note that if such graph has $n$ vertices, it will have exactly $n$ edges.

翻译中…

Alice and Bob take turn. Alice goes first. In each turn, the player can choose $k$ ($l \le k \le r$; $l \lt r$) vertices that form a connected subgraph and erase these vertices from the graph, including all incident edges.

翻译中…

The player who can't make a step loses.

翻译中…

For example, suppose they are playing on the given graph with given $l = 2$ and $r = 3$:

翻译中…

image

翻译中…

A valid vertex set for Alice to choose at the first move is one of the following:

翻译中…
  • $\{1, 2\}$
  • $\{1, 3\}$
  • $\{2, 3\}$
  • $\{4, 5\}$
  • $\{4, 6\}$
  • $\{5, 6\}$
  • $\{1, 2, 3\}$
  • $\{4, 5, 6\}$
翻译中…

Suppose, Alice chooses subgraph $\{4, 6\}$.

翻译中…

Then a valid vertex set for Bob to choose at the first move is one of the following:

翻译中…
  • $\{1, 2\}$
  • $\{1, 3\}$
  • $\{2, 3\}$
  • $\{1, 2, 3\}$
翻译中…

Suppose, Bob chooses subgraph $\{1, 2, 3\}$.

翻译中…

Alice can't make a move, so she loses.

翻译中…

You are given a graph of size $n$ and integers $l$ and $r$. Who will win if both Alice and Bob play optimally.

翻译中…

Input

翻译中…

The first line contains three integers $n$, $l$ and $r$ ($3 \le n \le 2 \cdot 10^5$; $1 \le l \lt r \le n$) — the number of vertices in the graph, and the constraints on the number of vertices Alice or Bob can choose in one move.

翻译中…

Next $n$ lines contains edges of the graph: one edge per line. The $i$-th line contains two integers $u_i$ and $v_i$ ($1 \le u_i, v_i \le n$; $u_i \neq v_i$) — description of the $i$-th edge.

翻译中…

It's guaranteed that the degree of each vertex of the given graph is equal to $2$.

翻译中…

Output

翻译中…

Print Alice (case-insensitive) if Alice wins, or Bob otherwise.

翻译中…

Note

翻译中…

In the first test the same input as in legend is shown.

翻译中…

In the second test the same graph as in legend is shown, but with $l = 1$ and $r = 2$.

翻译中…

样例

Input #1
6 2 3
1 2
2 3
3 1
4 5
5 6
6 4
Output #1
Bob
InputCopy OutputCopy
Input #2
6 1 2
1 2
2 3
3 1
4 5
5 6
6 4
Output #2
Bob
InputCopy OutputCopy
Input #3
12 1 3
1 2
2 3
3 1
4 5
5 6
6 7
7 4
8 9
9 10
10 11
11 12
12 8
Output #3
Alice
InputCopy OutputCopy
题目信息
题号
1823E
时间限制
2 s
内存限制
256 MB
标签
暴力
动态规划
博弈论
图论
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。