#K40087. Determine the Winner in the Character Game
Determine the Winner in the Character Game
Determine the Winner in the Character Game
Alice and Bob are playing a game with two strings of equal length. In this game, Alice is only allowed to increment characters in her string, and Bob is only allowed to decrement characters in his string. For each position i (1 ≤ i ≤ n), let \( f(a_i,b_i)=1 \) if \( a_i b_i \), and \( f(a_i,b_i)=0 \) if \( a_i=b_i \). The total score is defined as:
[ \text{score} = \sum_{i=1}^{n} f(a_i,b_i), ]
If the total score is positive, then Alice wins; otherwise, Bob wins. Given two strings, determine the winner.
inputFormat
The input consists of two lines. The first line contains the string a and the second line contains the string b. It is guaranteed that the two strings have the same length.
outputFormat
Output a single line containing either Alice
or Bob
– the name of the winner.
abc
bcd
Alice
</p>