# 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 13:24:56
2016-05-28 13:08:29
2016-05-28 13:07:18
2016-05-28 13:06:29
 Task: Cent saving Sender: zah Submission time: 2016-05-28 13:24:56 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 <iostream>

using namespace std;

//ios_base::sync_with_stdio(0);
//cin.tie(0);

int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
long long t;
cin >> t;
long long n;
long long x;
long long modulo;
long long kol;
long long nel;
long long summa;
long long tmp;
/*int alkuluvut[1001] = {};
alkuluvut[1] = 1;
for(int i=2; i<100; i++) {
for(int j=i*i; j<1001; j+=i) alkuluvut[j]=1;
} */

for(int i=0; i<t; i++) {
cin >> n;
summa = 0;
kol = 0;
nel = 0;
for(int j=0; j<n; j++) {
cin >> x;
summa += x;
modulo = x%5;
if(modulo<3) {
summa -= modulo;
} else {
if(modulo==4) {
nel += 1;
} else kol += 1;
}
}
tmp = min(kol,nel);
summa -= 2*tmp;
kol -= tmp;
nel -= tmp;
if(kol==0) {
summa -= 2*(nel/3);
summa += nel%3 ;
} else {
summa -= kol/2;
summa += (kol%2)*2;
}
cout << summa << "\n";
}
}

```

## 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