`{"id":"05d597af-caac-403e-b984-53fba0160201","name":"One Two Three Game","description":"Two players Alice and Bob are playing a game. They have a pile with n coins in it. They can pick either 1 or 2 coins in one turn. Alice goes first and they take alternate turns.The player who picks the last coin is the winner. Can you find out the winner.","inputFormat":"The first line contains integer n(no. of coins in the pile).\r\n","outputFormat":"Print the winner (ALICE or BOB).","constraints":"1&lt;= n &lt;= 10^18","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.BufferedReader;\r\nimport java.io.IOException;\r\nimport java.io.InputStreamReader;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws NumberFormatException, IOException {\r\n\r\n\r\n }\r\n}\r\n"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"10","sampleOutput":"ALICE\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"1191e2be-22c8-444b-988f-201dc78b143e","name":"Game Theory For Experts","slug":"game-theory-for-experts-930","type":0},{"id":"165903b3-9bcf-4dba-9c15-b4b192f6b6f6","name":"One Two Three Game","slug":"one-two-three-game","type":1}],"next":{"id":"e15d91ef-6e16-48d5-ab94-31a70c26b00a","name":"Nim Game","type":1,"slug":"nim-game"},"prev":null}}`

# One Two Three Game

Two players Alice and Bob are playing a game. They have a pile with n coins in it. They can pick either 1 or 2 coins in one turn. Alice goes first and they take alternate turns.The player who picks the last coin is the winner. Can you find out the winner.

`{"id":"05d597af-caac-403e-b984-53fba0160201","name":"One Two Three Game","description":"Two players Alice and Bob are playing a game. They have a pile with n coins in it. They can pick either 1 or 2 coins in one turn. Alice goes first and they take alternate turns.The player who picks the last coin is the winner. Can you find out the winner.","inputFormat":"The first line contains integer n(no. of coins in the pile).\r\n","outputFormat":"Print the winner (ALICE or BOB).","constraints":"1&lt;= n &lt;= 10^18","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.BufferedReader;\r\nimport java.io.IOException;\r\nimport java.io.InputStreamReader;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws NumberFormatException, IOException {\r\n\r\n\r\n }\r\n}\r\n"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"10","sampleOutput":"ALICE\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"1191e2be-22c8-444b-988f-201dc78b143e","name":"Game Theory For Experts","slug":"game-theory-for-experts-930","type":0},{"id":"165903b3-9bcf-4dba-9c15-b4b192f6b6f6","name":"One Two Three Game","slug":"one-two-three-game","type":1}],"next":{"id":"e15d91ef-6e16-48d5-ab94-31a70c26b00a","name":"Nim Game","type":1,"slug":"nim-game"},"prev":null}}`

Editor

# One Two Three Game

easy

Two players Alice and Bob are playing a game. They have a pile with n coins in it. They can pick either 1 or 2 coins in one turn. Alice goes first and they take alternate turns.The player who picks the last coin is the winner. Can you find out the winner.

1<= n <= 10^18

## Format

### Input

The first line contains integer n(no. of coins in the pile).

### Output

Print the winner (ALICE or BOB).

## Example

Sample Input

`.css-23h8hz{color:inherit;font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;}10`

### Sample Output

```.css-3oaykw{color:var(--chakra-colors-active-primary);font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;font-family:Monospace;}ALICE ```

Discussions

Show Discussion

Related Resources