jakaria_hossain

toph - Sofdor Ali and Histogram

Oct 2nd, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define fast()(ios_base::sync_with_stdio(false),cin.tie(NULL));
  4. typedef long long ll;
  5. int main()
  6. {
  7. fast();
  8. ll t,c=1;
  9. cin>>t;
  10. while(t--)
  11. {
  12. ll n,x=0,i=0;
  13. cin>>n;
  14. while(i<n)
  15. {
  16. ll j;
  17. cin>>j;
  18. j*=n-i;
  19. x=max(x,j);
  20. i++;
  21. }
  22. cout<<"Case "<<c++<<": "<<x<<endl;
  23. }
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment