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 n,r,b(1n,r,b105)n,r,b(1\leq n,r,b\leq 10^5) denoting the number cards , red cards in his pocket and blue cards in his pocket.

The second lines contains a string SS of length nn. It is guaranteed that each character in SS 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

福建师范大学第十九届程序设计竞赛正式赛

未参加
状态
已结束
规则
ACM/ICPC
题目
13
开始于
2022-5-22 9:00
结束于
2022-5-22 14:00
持续时间
5 小时
主持人
参赛人数
25