Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
- #define int long long
- #define endl "\n"
- #define PI acos(-1.0)
- #define IN freopen("input.txt",'r',stdin)
- const int MOD = 1e9+7;
- const int INF = 2e5+5;
- const int N = 205;
- int BIGMOD(int b, int p)
- {
- int ans = 1 % MOD, x = b % MOD;
- while(p){
- if(p&1)ans = (ans * x)%MOD;
- x = (x*x)%MOD;
- p >>= 1LL;
- }
- return ans;
- }
- void solve();
- int32_t main()
- {
- IOS;
- cout << fixed << setprecision(10);
- int _ = 1;
- cin >> _;
- while(_--) solve();
- return 0;
- }
- void solve()
- {
- string s;
- cin >> s;
- int sz = s.size();
- if(sz == 6){
- cout << "1.0 Over ";
- }
- else if(sz < 6){
- cout << "0." << sz << " Over ";
- }
- else{
- cout << sz / 6 << "." << sz%6 << " Overs ";
- }
- int wicket = 0;
- int run = 0;
- for(int i=0;i<sz;i++){
- if(s[i] == 'W'){
- wicket++;
- }
- else{
- run += (s[i] - '0');
- }
- }
- cout << run;
- if(run < 2){
- cout << " Run ";
- }
- else{
- cout << " Runs ";
- }
- cout << wicket;
- if(wicket < 2){
- cout << " Wicket.\n";
- }
- else{
- cout << " Wickets.\n";
- }
- }
- ///Must see the constraints range
- ///Calculate the Time
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement