Codeforces Round 293 (Div. 2)
B
Tanya and Postcard
Codeforces
1400
原题
← AC →
翻译中…

Little Tanya decided to present her dad a postcard on his Birthday. She has already created a message — string $*s*$ of length $*n*$, consisting of uppercase and lowercase English letters. Tanya can't write yet, so she found a newspaper and decided to cut out the letters and glue them into the postcard to achieve string $*s*$. The newspaper contains string $*t*$, consisting of uppercase and lowercase English letters. We know that the length of string $*t*$ greater or equal to the length of the string $*s*$.

翻译中…

The newspaper may possibly have too few of some letters needed to make the text and too many of some other letters. That's why Tanya wants to cut some $*n*$ letters out of the newspaper and make a message of length exactly $*n*$, so that it looked as much as possible like $*s*$. If the letter in some position has correct value and correct letter case (in the string $*s*$ and in the string that Tanya will make), then she shouts joyfully "YAY!", and if the letter in the given position has only the correct value but it is in the wrong case, then the girl says "WHOOPS".

翻译中…

Tanya wants to make such message that lets her shout "YAY!" as much as possible. If there are multiple ways to do this, then her second priority is to maximize the number of times she says "WHOOPS". Your task is to help Tanya make the message.

翻译中…

Input

翻译中…

The first line contains line $*s*$ ($1 ≤ |*s*| ≤ 2·10^{5}$), consisting of uppercase and lowercase English letters — the text of Tanya's message.

翻译中…

The second line contains line $*t*$ ($|*s*| ≤ |*t*| ≤ 2·10^{5}$), consisting of uppercase and lowercase English letters — the text written in the newspaper.

翻译中…

Here $|*a*|$ means the length of the string $*a*$.

翻译中…

Output

翻译中…

Print two integers separated by a space:

翻译中…
  • the first number is the number of times Tanya shouts "YAY!" while making the message,
  • the second number is the number of times Tanya says "WHOOPS" while making the message.
翻译中…

样例

Input #1
AbC
DCbA
Output #1
3 0
InputCopy OutputCopy
Input #2
ABC
abc
Output #2
0 3
InputCopy OutputCopy
Input #3
abacaba
AbaCaBA
Output #3
3 4
InputCopy OutputCopy
题目信息
题号
518B
时间限制
2 s
内存限制
256 MB
标签
贪心
模拟
字符串

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。