fork download
  1. /*
  2.  
  3.  
  4.  
  5.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░
  6.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░▒░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░
  7.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒▓▓▓▓▒▒░▒▒░░▒░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░
  8.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒░░▒▒▒▒▒░▒▓▓██▓▓▓▓▓▓▓▓▓▓▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░
  9.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▓▓▓▓█████▓▓███▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░
  10.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░▒░▒▒▓▓▓████████▓▓▓▓▓▓▓▒░▒░░░░░▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░
  11.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒░░░▒▒▒▒▒▒▒▒▒▒▓▒▒▒▒▒▒▓▓█▓▓░░░░░░▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░
  12.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒░░▒▒▒▒▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▒░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░
  13.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒▒▒▒▒▒▒▒░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░
  14.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓░░▒▒▒▒▒▒░░░▒▒▒▒▒░░▒▒▒▒▒▒▒░░░░░░░░░░░
  15.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒░▒▒▓▓▓▒▓▓▓▒▒▓▓▓▒▒▒▒▓▒░░░░░▒▒▒▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒▒▒▒▒░░░░░░░
  16.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▓▒░▒▒▒▒▒▒▓▒▒▒▒▒▒▒▒▒▓▒░░░░░░░▒▒▒▒▒▒▒▒▒▒░░░░░▒▒▒▒▒▒▒▒░░░░░░░
  17.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░▒▒▒▒▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒░░░░▒▒▒▒░░
  18.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒░▒▒▒▒▓▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░▒▒▒▒▒▒▒▒░░░▒▒▒░░░░░░░▒▒▒▒▒▒
  19.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒
  20.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▓▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒░░▒▒▒▒░░░░░░░▒▒▒▒
  21.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▓▓▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒░░░░░▒▒░░░░░▒▒▒░░░
  22.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░▒░░░░░▒▒▒░░
  23.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒░▒▓▓▓▓▒▒▒▒▒▒▒▒░▓▓▒░░░░░░░▒▒▒▒▒░▒▒▒▒▒▒░░░░░░░░░░░░░░░▒▒▒▒
  24.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒░░░▒▒▒▓▓▓▓▒▒▒▒▒▒▒░▒▓███▓▒▒▒▒▒▒▒▒░░░▒▒▒▒▒▒▒░░░░░░▒░░░░░░░░▒▒▒
  25.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒░▒▒▓▒▒▓▓▓▒▒▒▒▒░░░▓██████▓▓▓▓▓▓▒▒▒░▒▒▒▒▒▒▒░░░░░░▒░░░░░░░░▒▒▒
  26.   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▓▓▓▒▒▒░▒▒▒▒▒▒▓▓▓▒▒░░░▒████████████████▓▓▓▓▒▒▒▒░░░░░░▒░░░░░░░▒▒▒▒
  27.   ░░░░░░░░░░░░░░░░░░▒▒▒░░░░░▒▒▒▓▓██▓█▓▒░▒▒▒▓▓▓▒▒▓▒▒░░░░▒▓██████████████████████▓▒░░░░░▒▒░░░░░░▒▒▒▒▒
  28.   ░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▓▓▓▓███████▓▒░▒▒▒▓▓▓▒▒▒░░░░░▒██████████████████████████▒░░░░▒▒░░░░░▒▒▒░░░
  29.   ░░▒░░░░░░░░░░░░░▒▒▒▒▒▒▓█████████████▓██▒▒▓▓▓▒▒▓▓▒░░▒███████████████████████████▓░▒▒▒▒▒░░░░▒▒▒▒░░░
  30.   ░▒░▒░░░░░░░░░░░░░░▒▒▒▒▓████████████████▓▓▓▓▓▒▒▓▒▒▒▒▒████████████████████████████▒░░░▒▒▒▒░▒▒▒░░░░░
  31.   ▒▒▒▒▒▒▒░░░░░░░░░░░░░▒▒▓████████████████▓▓▓▓▒▒▓▒▒▒▒▒██████████████████████████████▒░░░░▒▒▒▒▒▒▒▒▒▒░
  32.   ▒▒▒▒▒▒▒░░░░░░░░░░░░▒▒▒▓██████████████████▒▒▒▓▒▒▒▒▒▓██████████████████████████████▒░░░░░▒▒▒▒▒▒▒▒▒▒
  33.   ▒▒▒▒▒▒▒▒░░░░░░░▒▒▒▒▒▒▒▓████████████████▓▓▒▒▒▒▒▒▒▒▓███████████████████████████████▓░░░░▒▒▒▒▒▒▒░░░░
  34.   ▒▒░░▒▒▒▒▒░░░░░░▒▒▒▒▒▒▒▓████████████████▓▒▒▒▒▒▒▒▒▓█████████████████████████████████▓░░░▒▒▒▒▒▒▒▒░░░
  35.   ▒▒░░░▒▒▒▒▒░░░░░░▒▒▒▒▒▒████████████████▓▒▒▒▒▒▒▒▓▓███████████████████████████████████▒░░░▒▒▒░▒▒▒░░░
  36.   ▒░░░░░▒░░░░░░░░░░░▒▒▒▓█████████████████▒▒▒▒▒▓████████████████████████████████████████▓▓▒▒░░░▒░░░░
  37.   ▒░░░░░▒░░░░░░░░░░▒▒▒▒▓█████████████████▓▓▓▓▓████████████▒▒▒▒▒▒▒▒▓▓██████████████████████▓░░░░░░░░
  38.   ░░░░░▒▒▒░░░░░░░░░▒░▒▒▓████████████████████▓▓█▓▓▓████████▒▓▓▓▓▓▓▒▒▒▓████████████████████████▓░░░░░
  39.   ░░░▒▒▒▒░░░░░░░░▒▒▒▒▒▒▒████████████████████▓▓▓▓▒▓████████▓▓▓▓▓▓▓▓▒▒▒▒▓████████████████████████▒▒▒░
  40.   ░░▒▒▒▒▒▒░░░░░░░▒▒▒▒▒▒▒█████████████████▓▓▒▓▓▒▒▒▓█████████▓▓▓▓▒▒▒▒▒▒▒▒████████████████████████▓░▒▒
  41.   ▒▒▒▒▒░░░░▒▒░░░░░▒▒▒▒▒▒█████████████████▓▒▒▓▓▒▓▓███████████▓▓▓▒▒▒▒▒▒▒▒▓███████████████████████▓░▒▒
  42.   ▒▒░░░░░░░░░░░░░░░▒▒▒▒▒▓████████████████▓▓▒▓▓▓▓▓████████████████▓▓▓▒▒▒▓███████████████████████▓░▒▒
  43.   ▒▒░░░░░░░░░░░░░░▒▒▒▒▒▓█████████████████▓▓▓▓▓██████████████████████▓▓▓▓▓███████████████████████▒▒▒
  44.   ░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▓▓▓▓▓███▓▓▒▒▒▒▓▓▓▓██▓▓████████████████████████████████▒▓▒████████████████▒▒▒
  45.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓███▓▒▒▒▓▓▓▓▓▓▓█████▓██▓███████████████████████████████████████████████▒▒▒▒
  46.   ▒░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▓██▓▓▓▓▒▓▓▓▓▓▓▓▓███▓▓▓▓▓████████████████████████████████████████████▓▒▒▒▒▒▒
  47.   ▒▒▒▒░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▓█▓███▓▓▓▓▓▓▓▓▓▓███▓▓▓▓▓█████████████████████████████▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  48.   ▒▒▒░▒░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓█████▓▓▓▓▓▓▓▓████▓▓▓▓▓██████████████████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  49.   ▒▒▒▒░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██▓▓▓▓▓▓█████▓▓▓▓███████████████████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  50.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓█████████████▓█████████████████████████████████▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  51.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████████▓█████████████████████████████████▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  52.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓█████▓▓▓▓▓██████████████████████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  53.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓█████▓▓▓▓▓▓█████████████████████████████████▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  54.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓█████▓▓▓▓▓▓██████████████████████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  55.  
  56.  
  57.  
  58. */
  59.  
  60. #include <bits/stdc++.h>
  61. #define ll long long
  62. #define dou double
  63. #define fi first
  64. #define se second
  65. #define pa pair<ll, ll>
  66. #define pa2 pair<ll, pa>
  67. using namespace std;
  68. const ll mod = 1e9 + 7;
  69. const ll maxN = 1e5 + 6;
  70. const ll inf = LLONG_MAX;
  71. const ll dx[] = {0, 0, -1, 1};
  72. const ll dy[] = {-1, 1, 0, 0};
  73. ll n;
  74. dou res[10];
  75. int main()
  76. {
  77. // freopen(".inp", "r", stdin);
  78. // freopen(".out", "w", stdout);
  79. ios_base::sync_with_stdio(0);
  80. cin.tie(0);cout.tie(0);
  81. cin >> n;
  82. for (int i = 1; i <= n; i++)
  83. {
  84. dou a;
  85. cin >> a;
  86. res[1] += a;
  87. if (a < 0) res[2] += a;
  88. if (a > 0) res[3] += a;
  89. if (i % 2 == 0) res[4] += a;
  90. if (i % 2 == 1) res[5] += a;
  91. }
  92. for (int i = 1; i <= 5; i++) cout << fixed << setprecision(2) << res[i] << " ";
  93. }
  94.  
  95.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
0.00 0.00 0.00 0.00 0.00