2025-06-20 18:08:35 +09:00

20 lines
312 B
C

#include <stdio.h>
int main() {
int N;
scanf("%d",&N);
int three, five = N/5;
while(five!=-1) {
if( (N-five*5)%3 == 0 ) {
three = (N-five*5)/3;
printf("%d\n",three+five);
return 0;
}
five--;
}
printf("-1\n");
return 0;
}