For this Question: Let's define two functions G(X) and F(X) where G(X) will give us the closest prime greater than or equal to X and F(X) will give us the smallest digit (0-9) in X. 

Given two integers N and M, Your task is to print the value the sum of values of F(G(i)) for each I from N to M.

<b>Note</b>:- 
We have already provided you the function G(X) which returns the closest prime greater than or equal to X. To use the given function you have to call <b>next_prime(x)</b>.

<b>Note</b>:- Do not close your main class.The input contains two space- separated integers depicting the values of N and M.

Constraints:-
1 <= N <= M <= 10000Print the sum of F(G(i)) for each i from N to M.Sample Input:-
1 10

Sample Output:-
34

Explanation:-
Numbers:- 1 2 3 4 5 6 7 8 9 10
G(i):- 2 2 3 5 5 7 7 11 11 11
F(G(i)):- 2 2 3 5 5 7 7 1 1 1 
Sum=34

Sample Input:-
8 11

Sample Output:-
4, I have written this Solution Code: 
import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m = sc.nextInt();
		int cnt=0;
		for(int i=n;i<=m;i++){
		    cnt+=F(next_prime(i));
		}
	    System.out.println(cnt);
	
	

}
public static int F(int n){
    int m=9;
    while(n>0){
        if(n%10<m){m=n%10;}
        n/=10;
    }
    return m;
}	    



, In this Programming Language: Java, Now tell me if this Code is compilable or not?