We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
/* By: harshvcode | harshvsingh.223@gmail.com Created at: 03:46:09_PM_21-JUNE-2020*/#include<bits/stdc++.h>#define LL long long#define M 1000000009#define NL '\n';#define PB push_back#define Ai vector<int> arrusingnamespacestd;intmain(){ios::sync_with_stdio(0);cin.tie(0);intn,h;cin>>n>>h;intans=0;Ai(n),len(n);for(inti=0;i<n;i++)cin>>arr[i];for(inti=0;i<n;i++)cin>>len[i];for(inti=0;i<n;i++){intchecker=arr[i]-h;if(checker<1)continue;ans=max(ans,(checker-(len[i]/4)));}cout<<ans<<NL;return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Hanging Posters
You are viewing a single comment's thread. Return to all comments →