Codeforces 101775C - Traffic Light Solution
Solution in C++:
///******Bismillahir-Rahmanir-Rahim******///
///AH Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t,k,i;
- cin>>t;
- for(k=1; k<=t; k++)
- {
- int n;
- double a,s=0;
- cin>>n;
- for(i=0; i<=n; i++)
- {
- cin>>a;
- s+=a;
- }
- double g,r,temp=0;
- for(i=1; i<=n; i++)
- {
- cin>>g>>r;
- temp=max(temp,r);
- }
- printf("Case #%d: %.10f\n",k,s+temp);
- }
- }
No comments