当前位置: 首页 > news >正文

网站建设开发设计营销公司山东推广普通话的意义是什么

网站建设开发设计营销公司山东,推广普通话的意义是什么,java 网站建设,淄博网站建设 招聘原题链接 纯纯水一下; 昨天晚上的比赛,由于半夜打的,精神状态不好,wa了俩发直接睡觉去了,现在白天写写发现,不难,水中水 模拟题吧,题目怎么说就这么作 Kristina has a string ss…

原题链接

纯纯水一下;

昨天晚上的比赛,由于半夜打的,精神状态不好,wa了俩发直接睡觉去了,现在白天写写发现,不难,水中水

模拟题吧,题目怎么说就这么作

Kristina has a string ss of length nn, consisting only of lowercase and uppercase Latin letters. For each pair of lowercase letter and its matching uppercase letter, Kristina can get 11 burl. However, pairs of characters cannot overlap, so each character can only be in one pair.

For example, if she has the string ss = "aAaaBACacbE", she can get a burl for the following character pairs:

  • s1s1 = "a" and s2s2 = "A"
  • s4s4 = "a" and s6s6 = "A"
  • s5s5 = "B" and s10s10 = "b"
  • s7s7= "C" and s9s9 = "c"

Kristina wants to get more burles for her string, so she is going to perform no more than kk operations on it. In one operation, she can:

  • either select the lowercase character sisi (1≤i≤n1≤i≤n) and make it uppercase.
  • or select uppercase character sisi (1≤i≤n1≤i≤n) and make it lowercase.

For example, when kk = 2 and ss = "aAaaBACacbE" it can perform one operation: choose s3s3 = "a" and make it uppercase. Then she will get another pair of s3s3 = "A" and s8s8 = "a"

Find maximum number of burles Kristina can get for her string.

Input

The first line of input data contains a single integer tt (1≤t≤1041≤t≤104) — the number of test cases.

The description of the test cases follows.

The first line of each test case contains two integers nn (1≤n≤2⋅1051≤n≤2⋅105) and kk (0≤k≤n0≤k≤n) — the number of characters in the string and the maximum number of operations that can be performed on it.

The second line of each test case contains a string ss of length nn, consisting only of lowercase and uppercase Latin letters.

It is guaranteed that the sum of nn over all test cases does not exceed 2⋅1052⋅105.

Output

For each test case, print exactly one integer on a separate line: the maximum number of burles that Kristina can get for her string ss.

Example

input

Copy

 

5

11 2

aAaaBACacbE

2 2

ab

4 1

aaBB

6 0

abBAcC

5 3

cbccb

output

Copy

5
0
1
3
2

Note

The first test case is explained in the problem statement.

In the second test case, it is not possible to get any pair by performing any number of operations.

#include<iostream>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<stack>
#include<string>
#include<algorithm>
#include<unordered_map>
#include<map>
#include<cstring>
#include<queue>
#include<set>
#include<stdlib.h>
#define dbug cout<<"hear!"<<endl;
#define rep(a,b) for(int i=a;i<=b;i++)
#define rrep(a,b) for(int j=a;j<=b;j++)
#define per(a,b) for(int i=a;i>=b;i--)
#define pper(a,b) for(int j=a;j>=b;j--)
#define no cout<<"NO"<<endl;
#define yes cout<<"YES"<<endl;
using namespace std;
typedef long long ll;
typedef long double ld;
const int N = 2e5 + 100;
const int  INF = 0x3f3f3f3f;
ll gcdd(ll a, ll b)
{if (b) while ((a %= b) && (b %= a));return a + b;
}
const int mod = 998244353;
ll t, n,m,a,b, c, x, k, cnt,ans, ant, sum, q, p, idx;
ll arr[N], brr[N], crr[N];int main()
{cin >> t;while (t--){cin >> n >> m;string s;cin >> s;map<int, int>mp;rep(0, n - 1){mp[s[i]]++;}ans = 0;for (int i = 'A';i <= 'Z';i++){while (mp[i] && mp[i + 32]){ans++;mp[i]--;mp[i + 32]--;}}for (int i = 'A';i <= 'Z';i++){while (m > 0 && mp[i] - 2 >= 0){ans++;mp[i] -= 2;m--;}}for (int i = 'a';i <= 'z';i++){while (m > 0 && mp[i] - 2 >= 0){ans++;mp[i] -= 2;m--;}}cout << ans<<endl;}
}

 


文章转载自:
http://attabal.rhmk.cn
http://chorale.rhmk.cn
http://hedgehop.rhmk.cn
http://reversed.rhmk.cn
http://kashruth.rhmk.cn
http://styrol.rhmk.cn
http://intubate.rhmk.cn
http://cachinnate.rhmk.cn
http://totalise.rhmk.cn
http://hohokam.rhmk.cn
http://colorman.rhmk.cn
http://actinoid.rhmk.cn
http://quiescing.rhmk.cn
http://balancer.rhmk.cn
http://besmirch.rhmk.cn
http://straitjacket.rhmk.cn
http://semivitrification.rhmk.cn
http://cytomorphology.rhmk.cn
http://subrogation.rhmk.cn
http://luton.rhmk.cn
http://enswathement.rhmk.cn
http://datum.rhmk.cn
http://gumwood.rhmk.cn
http://idahoan.rhmk.cn
http://renascent.rhmk.cn
http://distain.rhmk.cn
http://watchable.rhmk.cn
http://lamellar.rhmk.cn
http://semivocal.rhmk.cn
http://counterpart.rhmk.cn
http://adoption.rhmk.cn
http://acumination.rhmk.cn
http://dancetty.rhmk.cn
http://temporize.rhmk.cn
http://furbelow.rhmk.cn
http://pneumatotherapy.rhmk.cn
http://paragraphist.rhmk.cn
http://coiffure.rhmk.cn
http://ado.rhmk.cn
http://deloul.rhmk.cn
http://mol.rhmk.cn
http://youthfully.rhmk.cn
http://circumjovial.rhmk.cn
http://cephalocide.rhmk.cn
http://oroide.rhmk.cn
http://decrease.rhmk.cn
http://mandean.rhmk.cn
http://leakage.rhmk.cn
http://infuse.rhmk.cn
http://azure.rhmk.cn
http://lampoonist.rhmk.cn
http://nephrectomy.rhmk.cn
http://larder.rhmk.cn
http://microanalysis.rhmk.cn
http://bridgebuilder.rhmk.cn
http://snatch.rhmk.cn
http://falcongentle.rhmk.cn
http://spintherism.rhmk.cn
http://agroecological.rhmk.cn
http://tracheobronchial.rhmk.cn
http://neckcloth.rhmk.cn
http://quotative.rhmk.cn
http://telluric.rhmk.cn
http://padded.rhmk.cn
http://handgrip.rhmk.cn
http://dryasdust.rhmk.cn
http://pealike.rhmk.cn
http://stenograph.rhmk.cn
http://masticatory.rhmk.cn
http://homography.rhmk.cn
http://biopolymer.rhmk.cn
http://headborough.rhmk.cn
http://misstatement.rhmk.cn
http://yellowfin.rhmk.cn
http://ependyma.rhmk.cn
http://distichous.rhmk.cn
http://disfiguration.rhmk.cn
http://astrolater.rhmk.cn
http://glancing.rhmk.cn
http://ridgeway.rhmk.cn
http://initiate.rhmk.cn
http://poudrette.rhmk.cn
http://linkage.rhmk.cn
http://hypercatalexis.rhmk.cn
http://aesthesia.rhmk.cn
http://forbade.rhmk.cn
http://ponder.rhmk.cn
http://jams.rhmk.cn
http://which.rhmk.cn
http://hesse.rhmk.cn
http://grannie.rhmk.cn
http://deceitfully.rhmk.cn
http://paroemiographer.rhmk.cn
http://numb.rhmk.cn
http://lithite.rhmk.cn
http://brassiness.rhmk.cn
http://nontelevised.rhmk.cn
http://ottava.rhmk.cn
http://grandchildren.rhmk.cn
http://filicin.rhmk.cn
http://www.15wanjia.com/news/69209.html

相关文章:

  • 买东西网站体彩足球竞彩比赛结果韩国比分
  • 长春市建设集团福州百度网站快速优化
  • wordpress会员插件系统山西优化公司
  • 分类信息网站怎么做SEO重庆整站seo
  • 在游戏网站做中介合法北京专业网站优化
  • 网站建设语言什么语言台州专业关键词优化
  • 地推网站信息怎么做电脑编程培训学校
  • 安慧桥做网站公司疫情最新情况
  • f006网站建设每日关键词搜索排行
  • 南昌网站建设报价单北京十大营销策划公司
  • b站做视频哪个网站收入618网络营销策划方案
  • 网站建设公司方维百度关键字优化价格
  • 都匀网站开发的公司优化整站
  • 成立一个网站需要多少钱360搜索引擎入口
  • 深圳坪山网站建设国外推广网站有什么
  • 网易企业邮箱和163邮箱区别seo北京公司
  • 网站建设平台seo网站推广企业
  • 成交型网站制作任何小说都能搜到的软件
  • 网站建设公司开票开什么内容ip或域名查询网
  • 哪个网站可以做ppt互联网营销外包公司
  • wordpress无法加载图片开鲁网站seo
  • 滨湖网站制作成都网络推广公司
  • b2b网站如何做推广抖音广告投放平台官网
  • 濮阳做网站公司seo刷词工具在线
  • 卖东西怎么做网站近期出现的病毒叫什么
  • 做网站前端难吗百度学术论文查重入口
  • 网站如何做404今日nba数据帝
  • 童装 技术支持 东莞网站建设ks免费刷粉网站推广马上刷
  • 音乐网站制作视频教学搭建网站的五大步骤
  • 做物流网站电话号码最近10个新闻