fork(1) download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4.  
  5.  
  6. using namespace std;
  7. int y;
  8. int l,o;
  9.  
  10.  
  11. int main()
  12. {
  13. cin>>y;
  14.  
  15. for(int i= 1; i<=y; i++)
  16. {
  17. cin>>l>>o;
  18.  
  19. float obzartuchow[l];
  20. float tablica[l];
  21. float suma[l];
  22.  
  23. for(int i=1; i<=l; i++)
  24.  
  25. {
  26. {
  27. cin>>tablica[i];
  28. }
  29.  
  30. {
  31. obzartuchow[i]=( tablica[i]*o);
  32. obzartuchow[i]=86400/obzartuchow[i];
  33. cout<<obzartuchow[i]<<endl;
  34.  
  35. }
  36.  
  37. {
  38. suma[l]+=obzartuchow[i];
  39. }
  40.  
  41. {
  42. cout<<ceil(suma[l])<<endl;
  43. }
  44.  
  45.  
  46. }
  47. }
  48.  
  49. return 0;
  50. }
Success #stdin #stdout 0s 16064KB
stdin
2
2 10
3600
1800
3 356
123
32999
10101
stdout
2.4
3
4.8
8
1.97314
2
0.00735467
2
0.024027
3