# 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 11:55:42
 Task: Cent saving Sender: Ace of Spades Submission time: 2016-05-28 11:55:42 Language: C++ Status: READY Result: ACCEPTED

## Test results

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

## Code

```#include<bits/stdc++.h>

using namespace std;

int main(void) {
cin.tie(0);
ios_base::sync_with_stdio(false);
cout << fixed << setprecision(12);

int64_t t;
cin >> t;
for(;t>0;t--) {
int64_t n;
cin >> n;
int64_t total=0, p0=0, p1=0, p2=0, m2=0, m1=0;
for(int64_t i=0;i<n;i++) {
int64_t p;
cin >> p;
if(p%5 == 0) p0++;
if(p%5 == 1) p1++;
if(p%5 == 2) p2++;
if(p%5 == 3) m2++;
if(p%5 == 4) m1++;
total+=p;
}

total-=2*p2;
total-=p1;
if(m2 >= m1) {
m2-=m1;
total-=2*m1;
total-=m2/2;
if(m2%2 == 1) total+=2;
} else {
m1-=m2;
total-=2*m2;
total-=2*(m1/3);
if(m1%3 == 1) {
total++;
} else if(m1%3 == 2) {
total+=2;
}
}
cout << total << '\n';
}

return 0;
}
```

## Test details

### Test 1

Verdict: ACCEPTED

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
```475191144965 460688647850 478543444030 475238936090 456736521510 477687545180 464978309415 469754811210 473772861015 459378192990 484964363025 469227939745 476076446280 463968012420 480317542525 458834989560 472694971870 467845191980 475238640235 470940911790 ...```
view   save

### Test 2

Verdict: ACCEPTED

input
```1 100000 666086355 190481330 514353517 ...```
view   save

correct output
`47176864928795`
view   save

user output
`47176864928795`
view   save