fork download
  1. /********************************************************************
  2. * *
  3. * *
  4. * Coded By Colin *
  5. * *
  6. * *
  7. ********************************************************************/
  8.  
  9. #include<bits/stdc++.h>
  10.  
  11. #define fastio ios_base::sync_with_stdio(0)
  12.  
  13. #pragma warning(disable:4996)
  14.  
  15. typedef long long ll;
  16.  
  17. using namespace std;
  18.  
  19. int main()
  20. {
  21. long long i,j=0,n,sum=-1; cin>>n;
  22. vector <long long int> a1,b1,c1;
  23. for(i=0;i<n;i++){int x; cin>>x; a1.push_back(x);}
  24. for(i=0;i<n;i++){int x;cin>>x;b1.push_back(x);}
  25. for(i=0;i<n;i++){
  26. j=0;
  27. while(j<=i){
  28. if(sum<=a1[j]*b1[i]) sum=a1[j]*b1[i];
  29. j++;
  30. }
  31. cout<<sum<<endl;
  32. }
  33. }
  34.  
Success #stdin #stdout 0s 4720KB
stdin
3
3 2 20
1 4 1
stdout
3
12
20