CF518B.Tanya and Postcard

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Little Tanya decided to present her dad a postcard on his Birthday. She has already created a message — string ss of length nn , 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 ss . The newspaper contains string tt , consisting of uppercase and lowercase English letters. We know that the length of string tt greater or equal to the length of the string ss .

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 nn letters out of the newspaper and make a message of length exactly nn , so that it looked as much as possible like ss . If the letter in some position has correct value and correct letter case (in the string ss 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.

输入格式

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

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

Here a|a| means the length of the string aa .

输出格式

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.

输入输出样例

  • 输入#1

    AbC
    DCbA
    

    输出#1

    3 0
    
  • 输入#2

    ABC
    abc
    

    输出#2

    0 3
    
  • 输入#3

    abacaba
    AbaCaBA
    

    输出#3

    3 4
    
首页