eolymp
bolt
Try our new interface for solving problems
Problems

Product Triplet

Product Triplet

You are given six integers: \textbf{minx}, \textbf{maxx}, \textbf{miny}, \textbf{maxy}, \textbf{minz} and \textbf{maxz}. Find the number of triplets of integers (\textbf{x},\textbf{y},\textbf{z}) that satisfy the following three conditions: \begin{itemize} \item \textbf{x} is between \textbf{minx} and \textbf{maxx}, inclusive; \item \textbf{y} is between \textbf{miny} and \textbf{maxy}, inclusive; \item \textbf{z} is between \textbf{minz} and \textbf{maxz}, inclusive; \item \textbf{x} * \textbf{y} = \textbf{z}; \end{itemize} \InputFile Each line contains six integers \textbf{minx}, \textbf{maxx}, \textbf{miny}, \textbf{maxy}, \textbf{minz} and \textbf{maxz}. It is known that \textbf{1} ≤ \textbf{maxx}, \textbf{maxy}, \textbf{maxz} ≤ \textbf{10^9}, \textbf{1 }≤ \textbf{minx} ≤ \textbf{maxx, 1 }≤\textbf{ miny }≤\textbf{ maxy, 1 }≤\textbf{ minz }≤\textbf{ maxz}. \OutputFile For each line of input print in a separate line the number of triplets of integers (\textbf{x},\textbf{y},\textbf{z}) that satisfy the given above conditions.
Time limit 1 second
Memory limit 64 MiB
Input example #1
2 2 3 3 6 6
6 8 4 5 27 35
8176 184561 1348 43168 45814517 957843164
Output example #1
1
4
2365846085