fork download
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main()
  8. {
  9. int ile;
  10. int n;
  11. int m;
  12. int z;
  13. float g;
  14. int t;
  15. float f;
  16. float r;
  17. float l;
  18. float suma;
  19. float y;
  20. float x;
  21. int b;
  22.  
  23. cin>>ile;
  24. for (int i=1 ; i <= ile ;i++)
  25. {
  26.  
  27. cin >> n >>m;
  28.  
  29.  
  30. z=0;
  31. suma=0;
  32. for(int i=1 ; i <= n ;i++)
  33. {
  34. cin >> t;
  35. b = 86400/(t * m);
  36.  
  37. y=(float)t;
  38. x=(float)m;
  39. g = 86400/(y * x);
  40. if (g>0.01)
  41. {
  42. g = 86400/(y * x);
  43. suma+=g;
  44. }
  45. else
  46. g=b;
  47. if(i==n)
  48. {
  49. z = suma;
  50. f = suma - z;
  51. l=1-f;
  52. if(l==1 )
  53. l=0;
  54. f = l + suma;
  55.  
  56. }
  57.  
  58. }
  59. if (f==0)
  60. f=1;
  61. z = f ;
  62. cout << z << endl;
  63. }
  64. return 0;
  65. }
Success #stdin #stdout 0s 4352KB
stdin
2
2
10
3600
1800
3 
356
123
32999
10101
stdout
8
2