PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000076. Các số có đúng k ước nguyên tố phân biệt (N-Factorful)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Các số có đúng k ước nguyên tố phân biệt (N-Factorful)

N-Factorful

Source: SPOJ

Version: Phuoc Hung OJ Extended

Problem Statement

A positive integer is kk-factorful if it has exactly kk distinct prime divisors. For instance, 12=22⋅312=2^2\cdot3 is 22-factorful because its distinct prime divisors are 2,32,3. By convention, 11 is 00-factorful. Given a,b,ka,b,k, count the integers xx in the inclusive range [a,b][a,b] having exactly kk distinct prime divisors.

Input

One line contains three integers a,b,ka,b,k, in that order.

Output

Print the number of kk-factorful integers in [a,b][a,b].

Subtasks

  • Subtask 1 (20 points): 1≤a≤b≤1001\le a\le b\le 100; 0≤k≤100\le k\le10.
  • Subtask 2 (30 points): 1≤a≤b≤100001\le a\le b\le 10000; 0≤k≤100\le k\le10.
  • Subtask 3 (50 points): 1≤a≤b≤10000001\le a\le b\le 1000000; 0≤k≤100\le k\le10.

Examples

Input

1 10 2

Output

2

Explanation

In [1,10][1,10], the values 6=2⋅36=2\cdot3 and 10=2⋅510=2\cdot5 have exactly two distinct prime divisors. Numbers 4,8,94,8,9 have only one, and 11 has none. The answer is therefore 22.