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.
//Try This One...
//Coded By Himanshu And Jatin....
//Chandigarh University....
#include <bits/stdc++.h>
using namespace std;
int main(){
int s;
int n;
int m;
cin >> s >> n >> m;
int k[n];
int z=-1;
int u[m];for(int i=0;i<n;i++){ cin >> k[i];}for(int i=0;i<m;i++){
cin >> u[i];}for(int i=0;i<n;i++){for(int j=0;j<m;j++){if(k[i]+u[j]<=s && k[i]+u[j]>z)z=k[i]+u[j];}}
cout<<z;return0;}
Electronics Shop
You are viewing a single comment's thread. Return to all comments →