Cards
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Cards
Time limit: 1 seconds
Memory limit: 512 megabytes
Problem Statement
Cat Fu has a list of cards on his desk. Each card is either red or blue. Cat Fu also has some cards in his pocket, which are also painted red or blue.
Cat Fu doesn't like to see cards of the same color next to each other, so he wants to insert some cards in his pocket into the row of cards on the table so that cards of the same color are not adjacent.
Now he wants to know, to achieve his expectations, how many cards should there be at least on the desk? If this is not possible, he wants to know how many red cards and how many blue cards he needs to meet his expectations.
Input
The first line contains three integers denoting the number cards , red cards in his pocket and blue cards in his pocket.
The second lines contains a string of length . It is guaranteed that each character in is 'r' or 'b'.
Output
If Cat Fu can meet his expectations with the cards in his pocket print a single integer denoting the minimum possible cards on the desk, else print two integers denoting the number of red cards and blue cards he needs to meet his expectations.
5 2 1
rrbbr
5 2 5
rbrbr
10 1 1
rrbbrrrbrb
7
5
0 2