Codeforces Round 358 (Div. 2)
A
Alyona and Numbers
Codeforces
1100
原题
←B →
翻译中…

After finishing eating her bun, Alyona came up with two integers $*n*$ and $*m*$. She decided to write down two columns of integers — the first column containing integers from $1$ to $*n*$ and the second containing integers from $1$ to $*m*$. Now the girl wants to count how many pairs of integers she can choose, one from the first column and the other from the second column, such that their sum is divisible by $5$.

翻译中…

Formally, Alyona wants to count the number of pairs of integers $(*x*, *y*)$ such that $1 ≤ *x* ≤ *n*$, $1 ≤ *y* ≤ *m*$ and image equals $0$.

翻译中…

As usual, Alyona has some troubles and asks you to help.

翻译中…

Input

翻译中…

The only line of the input contains two integers $*n*$ and $*m*$ ($1 ≤ *n*, *m* ≤ 1 000 000$).

翻译中…

Output

翻译中…

Print the only integer — the number of pairs of integers $(*x*, *y*)$ such that $1 ≤ *x* ≤ *n*$, $1 ≤ *y* ≤ *m*$ and $(*x* + *y*)$ is divisible by $5$.

翻译中…

Note

翻译中…

Following pairs are suitable in the first sample case:

翻译中…
  • for $*x* = 1$ fits $*y*$ equal to $4$ or $9$;
  • for $*x* = 2$ fits $*y*$ equal to $3$ or $8$;
  • for $*x* = 3$ fits $*y*$ equal to $2$, $7$ or $12$;
  • for $*x* = 4$ fits $*y*$ equal to $1$, $6$ or $11$;
  • for $*x* = 5$ fits $*y*$ equal to $5$ or $10$;
  • for $*x* = 6$ fits $*y*$ equal to $4$ or $9$.
翻译中…

Only the pair $(1, 4)$ is suitable in the third sample case.

翻译中…

样例

Input #1
6 12
Output #1
14
InputCopy OutputCopy
Input #2
11 14
Output #2
31
InputCopy OutputCopy
Input #3
1 5
Output #3
1
InputCopy OutputCopy
Input #4
3 8
Output #4
5
InputCopy OutputCopy
Input #5
5 7
Output #5
7
InputCopy OutputCopy
Input #6
21 21
Output #6
88
InputCopy OutputCopy
题目信息
题号
682A
时间限制
1 s
内存限制
256 MB
标签
构造
数学
数论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。