CF1823E.Removing Graph

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 22 . The graph may consist of several components. Note that if such graph has nn vertices, it will have exactly nn edges.

Alice and Bob take turn. Alice goes first. In each turn, the player can choose kk ( lkrl \le k \le r ; l<rl < 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=2l = 2 and r=3r = 3 :

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

  • {1,2}\{1, 2\}
  • {1,3}\{1, 3\}
  • {2,3}\{2, 3\}
  • {4,5}\{4, 5\}
  • {4,6}\{4, 6\}
  • {5,6}\{5, 6\}
  • {1,2,3}\{1, 2, 3\}
  • {4,5,6}\{4, 5, 6\}

Suppose, Alice chooses subgraph {4,6}\{4, 6\} .Then a valid vertex set for Bob to choose at the first move is one of the following:

  • {1,2}\{1, 2\}
  • {1,3}\{1, 3\}
  • {2,3}\{2, 3\}
  • {1,2,3}\{1, 2, 3\}

Suppose, Bob chooses subgraph {1,2,3}\{1, 2, 3\} .Alice can't make a move, so she loses.

You are given a graph of size nn and integers ll and rr . Who will win if both Alice and Bob play optimally.

输入格式

The first line contains three integers nn , ll and rr ( 3n21053 \le n \le 2 \cdot 10^5 ; 1l<rn1 \le l < 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 nn lines contains edges of the graph: one edge per line. The ii -th line contains two integers uiu_i and viv_i ( 1ui,vin1 \le u_i, v_i \le n ; uiviu_i \neq v_i ) — description of the ii -th edge.

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

输出格式

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

输入输出样例

  • 输入#1

    6 2 3
    1 2
    2 3
    3 1
    4 5
    5 6
    6 4

    输出#1

    Bob
  • 输入#2

    6 1 2
    1 2
    2 3
    3 1
    4 5
    5 6
    6 4

    输出#2

    Bob
  • 输入#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

    输出#3

    Alice

说明/提示

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=1l = 1 and r=2r = 2 .

首页