Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- #define ff first
- #define ss second
- #define pb push_back
- #define ppb pop_back
- int main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- cout.tie(NULL);
- _test
- {
- int n, k;
- cin>>n>>k;
- string s;
- cin>>s;
- int MOD = 1e9 + 7;
- int cnt=0;
- int x = 0;
- ll int ans = 1;
- for(auto e: s)
- {
- if(e=='a' || e=='e' || e=='i' || e=='o' || e=='u')
- {
- cnt++;
- if(cnt == k+1)
- {
- cnt = 1;
- (ans *= (x+1)) %= MOD;
- }
- x = 0;
- }
- else
- x++;
- }
- cout<<ans<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment