# HIIT Open 2016

 Start: 2016-05-28 11:00:00 End: 2016-05-28 16:00:00

CSES - HIIT Open 2016 - Results
History
2016-05-28 12:38:26
2016-05-28 12:32:22
2016-05-28 12:29:13
 Task: Cent saving Sender: Noname 01 Submission time: 2016-05-28 12:32:22 Language: C++ Status: READY Result: WRONG ANSWER

## Test results

 test verdict time (s) #1 WRONG ANSWER 0.06 / 1.00 details #2 WRONG ANSWER 0.06 / 1.00 details

## Code

```// NONAME-01

#include <bits/stdc++.h>

using namespace std;

vector<long long> a;
long long c[5];
long long total;
int n;

{
cin >> n;
a.resize(n);
total = 0;
memset(c, 0, sizeof(c));
for (int i = 0; i < n; i++) {
cin >> a[i];
total += a[i];
c[a[i] % 5]++;
}
}

void Solve()
{
long long sav = 0;
// c0 ignore;
// c1 -> save 1;
// c2 -> save 2;
sav += c[1];
sav += 2*c[2];
sav -= 2*c[3];
sav -= c[4];
// group c[4] and c[3] for +5;
long long i = c[4];
if (i < c[3]) i = c[3];
sav += 5*i;
c[4] -= i;
c[3] -= i;
// group c3 together;
i = c[3] / 2;
sav += 5*i;
// group c4 together;
i = c[4] / 3;
sav += 5*i;
cout << total - sav << "\n";
}

int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int nt, tt;
cin >> nt;
for (tt = 0; tt < nt; tt++) {
Solve();
}
return 0;
}```

## Test details

### Test 1

input
```100 1000 528433894 255789530 559301042 ...```
view   save

correct output
```475191144965 460688647850 478543444030 475238936090 456736521510 477687545180 464978309415 469754811210 473772861015 459378192990 484964363025 469227939745 476076446280 463968012420 480317542525 458834989560 472694971870 467845191980 475238640235 470940911790 ...```
view   save

user output
```475191144945 460688647835 478543444010 475238936070 456736521500 477687545170 464978309415 469754811185 473772860995 459378192980 484964363015 469227939720 476076446275 463968012380 480317542520 458834989515 472694971855 467845191970 475238640220 470940911790 ...```
view   save

### Test 2

```1 100000 666086355 190481330 514353517 ...```
`47176864928795`
`47176864928575`