fork download
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int ni,ne,i=0;
  6. float int_p=18,ext_p=12,cost=0,temp;
  7. scanf("%d %d",&ni,&ne);
  8. if(ni<0 || ne<0 )
  9. {
  10. cout<<"INVALID INPUT";
  11. }
  12. else if(ni==0 && ne==0)
  13. {
  14. cout<<"Total estimated Cost : 0.0";
  15. }
  16. else
  17. {
  18. for(i=0;i<ni;i++)
  19. {
  20. cin>>temp;
  21. cost+= int_p*temp;
  22. }
  23. for(i=0;i<ne;i++)
  24. {
  25. cin>>temp;
  26. cost+= ext_p*temp;
  27. }
  28. cout<<"Total estimated Cost : "<<cost;
  29. }
  30. return 0;
  31. }
Time limit exceeded #stdin #stdout 5s 4988KB
stdin
Standard input is empty
stdout
Standard output is empty