codeparrot/codecomplex huggingface dataset:
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;

public class Division {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		String c = String.valueOf(l);
		if (String.valueOf(c).contains("0") || String.valueOf(c).contains("1")
				|| String.valueOf(c).contains("2")
				|| String.valueOf(c).contains("3")
				|| String.valueOf(c).contains("5")
				|| String.valueOf(c).contains("6")
				|| String.valueOf(c).contains("8")
				|| String.valueOf(c).contains("9"))
			if (l % 777 == 0 || l % 774 == 0 || l % 747 == 0 || l % 744 == 0
					|| l % 477 == 0 || l % 474 == 0 || l % 447 == 0
					|| l % 444 == 0 || l % 77 == 0 || l % 74 == 0
					|| l % 47 == 0 || l % 44 == 0 || l % 7 == 0 || l % 4 == 0)
				System.out.println("YES");
			else
				System.out.println("NO");
		else
			System.out.println("YES");
	}

}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    if (n % 4 == 0 || n % 7 == 0 || n % 47 == 0 || n % 77 == 0 || n % 74 == 0 || n % 447 == 0 || n % 474 == 0 || n % 477 == 0 || n % 747 == 0 || n % 774 == 0 || n % 777 == 0)
      System.out.println("YES");
    else
      System.out.println("NO");
  }
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;
/**
 * Write a description of class lukno here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class lukno
{
    public static void main (String args[])
    {
        Scanner i= new Scanner(System.in);
        int n,p;
       
        n=i.nextInt(); int t=n;
       if(t%4==0||t%7==0||t%47==0||t%74==0||t%44==0||t%447==0||t%474==0||t%477==0)
               System.out.print("YES");
               else System.out.print("NO");

    
           


}
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.LinkedList;
public class LuckyNumbers {

    public static void main(String[] args)throws IOException
    {
        BufferedReader scan=new BufferedReader(new InputStreamReader(System.in));
        short num=Short.parseShort(scan.readLine());
        if(funcion(num))
        {
            System.out.println("YES");
        }
        else
            System.out.println("NO");
    }
    public static boolean funcion(short num)
    {
        LinkedList<Short>queue=new LinkedList<Short>();
        queue.offer((short) 4);
        queue.offer((short) 44);
        queue.offer((short) 444);
        queue.offer((short) 47);
        queue.offer((short) 477);
        queue.offer((short) 7);
        queue.offer((short) 77);
        queue.offer((short) 777);
        queue.offer((short) 74);
        queue.offer((short) 744);
        while(queue.peek()!=null)
        {
            if(num%queue.poll()==0)
            {
                return true;
            }
        }
        return false;

    }
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.io.*;
import java.util.*;
import java.math.*;

public class Main
{
    public static void main(String args[])
    {
       Scanner scan=new Scanner(System.in);
       int n=scan.nextInt();
       System.out.println((n%4==0||n%7==0||n%47==0||n%74==0||n%447==0||n%474==0||n%477==0||n%744==0||n%747==0||n%774==0)?"YES":"NO");
    }
}
// Problem: 122_A. Lucky Division
// Time complexity: constant


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class A implements Runnable {

	private void Solution() throws IOException {
		int n = nextInt();
		if (n % 7 == 0 || n % 4 == 0 || n % 47 == 0 || n % 74 == 0 || n % 747 == 0 || n % 474 == 0 || n % 777 == 0 || n % 444 == 0 || n % 774 == 0 || n % 447 == 0 || n % 744 == 0 || n % 477 == 0)
			System.out.println("YES"); else 
				System.out.println("NO");
	}
	
	public static void main(String args[]) {
		new A().run();
	}
	
	BufferedReader in;
	StringTokenizer tokenizer;
	
	public void run() {
		try {
            in = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            Solution();
            in.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
	}

	int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}
	
	String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(in.readLine());
		return tokenizer.nextToken();
	}
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;
public class LuckyDivision {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        
        int n = in.nextInt();
        
        if( n % 4==0 ||
            n % 7==0 ||
            n % 47==0 ||
            n % 74==0 ||
            n % 447==0 ||
            n % 474==0 ||
            n % 477==0 ||
            n % 744==0 ||
            n % 774==0 ||
            n % 777==0
        )
            System.out.println("YES");
        else
            System.out.println("NO");
    }
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int in = sc.nextInt();
        if(
                in%4==0||
                in%7==0||
                in%44==0||
                in%47==0||
                in%74==0||
                in%77==0||
                in%444==0||
                in%447==0||
                in%474==0||
                in%477==0||
                in%744==0||
                in%747==0||
                in%774==0||
                in%777==0
                
        )
            System.out.println("YES");
        else System.out.println("NO");

    }

}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;

public class Task122A {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();
		
		if ( (n % 4 == 0)   ||
			 (n % 7 == 0)   ||
			 (n % 44 == 0)  ||
			 (n % 47 == 0)  ||
			 (n % 74 == 0)  ||
			 (n % 77 == 0)  ||
		   	 (n % 444 == 0) ||
			 (n % 447 == 0) ||
			 (n % 474 == 0) ||
			 (n % 477 == 0) ||
			 (n % 744 == 0) ||
			 (n % 747 == 0) ||
			 (n % 774 == 0) ||
			 (n % 777 == 0)    )
		{
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}
// Problem: 122_A. Lucky Division
// Time complexity: constant

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class A {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		Queue<Integer> q = new LinkedList<Integer>();
		q.add(4);
		q.add(7);
		boolean luck = false;
		while(!q.isEmpty() && !luck)
		{
			int f = q.poll();
			if(a%f == 0)
			{
				luck = true;
				break;
			}
			if(f<a)
			{
				int t = (f+"").length();
				int tt = (int)Math.pow(10, t);
				q.add(tt*4+f);
				q.add(tt*7+f);
			}
		}
		if(luck)
			System.out.println("YES");
		else
			System.out.println("NO");
		
	}

}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;

public class HelloWorld
{
    public static void main (String args [])
    {
        Scanner read = new Scanner(System.in);
        int n = read.nextInt();
        int n1 = n; boolean q = true;
        while (n1 > 0)
        {
            if (n % n1 == 0)
            {
                if (check(n1))
                {
                    System.out.print("YES");
                    q = false;
                    break;
                }   
            }
            n1--;
        }
        if (q) System.out.print("NO");
        
    }
    public static boolean check (int n)
    {
        int n1 = n;
        while (n1 != 0)
        {
            if (n1 % 10 != 4 && n1 % 10 != 7) return false;
            n1 /= 10;
        }
        return true;
    }

}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.io.PrintWriter;
import java.util.Scanner;

public class Solution {
    private static int n;
    private static PrintWriter writer;
    private static int maxstep;
    
    private static void g(int src, int step) {
        if (step != 0 && n % src == 0) {
            writer.print("YES");
            writer.close();
            System.exit(0);
        }
        
        if (step == maxstep) return;
        
        int p = (int)Math.pow(10, step);
        
        g(src + 4 * p, step + 1);
        g(src + 7 * p, step + 1);
    }
    
    public static void main(String[] args) throws Exception {        
        //Scanner reader = new Scanner(new File("input.txt"));
        //PrintWriter writer = new PrintWriter("output.txt");
        Scanner reader = new Scanner(System.in);
        writer = new PrintWriter(System.out);
        
        n = reader.nextInt();
        maxstep = String.valueOf(n).length() + 1;
        
        g(0, 0);
        
        writer.print("NO");
        writer.close();
    }
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;

public class LuckySubstring {
    
    static int[] luck;
    
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        
        int n = s.nextInt();
        int i = -1;
        boolean ehLuck = false;
        preencheLucky();
        while (n >= luck[++i]) {
            if (i > 13) {
                break;
            }
            if (n % luck[i] == 0) {
                ehLuck = true;
                break;
            }
        }
        if (ehLuck) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
    
    static void preencheLucky() {
        luck = new int[15];
        luck[0] = 4;
        luck[1] = 7;
        luck[2] = 44;
        luck[3] = 47;
        luck[4] = 74;
        luck[5] = 77;
        luck[6] = 444;
        luck[7] = 447;
        luck[8] = 474;
        luck[9] = 477;
        luck[10] = 744;
        luck[11] = 747;
        luck[12] = 774;
        luck[13] = 777;
    }
    
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.io.PrintWriter;
import java.util.Scanner;

public class n122A {
    Scanner in;
    PrintWriter out;

    void solve() {
        int n = in.nextInt();
        boolean good = false;
        if (n % 4 == 0) {
            good = true;
        }
        if (n % 7 == 0) {
            good = true;
        }
        if (n % 44 == 0) {
            good = true;
        }
        if (n % 47 == 0) {
            good = true;
        }
        if (n % 74 == 0) {
            good = true;
        }
        if (n % 77 == 0) {
            good = true;
        }
        if (n % 444 == 0) {
            good = true;
        }
        if (n % 447 == 0) {
            good = true;
        }
        if (n % 474 == 0) {
            good = true;
        }
        if (n % 477 == 0) {
            good = true;
        }
        if (n % 744 == 0) {
            good = true;
        }
        if (n % 747 == 0) {
            good = true;
        }
        if (n % 774 == 0) {
            good = true;
        }
        if (n % 777 == 0) {
            good = true;
        }
        if (good) {
            out.println("YES");
        } else {
            out.println("NO");
        }
    }

    void run() {
        in = new Scanner(System.in);
        out = new PrintWriter(System.out);
        try {
            solve();
        } finally {
            out.close();
        }
    }

    public static void main(String[] args) {
        new n122A().run();

    }

}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.*;
public class x
{
    public static void main(String args[])
    {
        Scanner obj=new Scanner(System.in);
        int n;
        String d="0";
        n=obj.nextInt();
        if(n%4==0 || n%7==0 || n%47==0 || n%74==0 || n%447==0 || n%474==0 || n%747==0)
        d="YES";
        else if(n%444==0 || n%477==0 || n%744==0 || n%774==0 || n%777==0)
        d="YES";
        else
        d="NO";
        System.out.print(d);
    }
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
		int a[]={4,7,44,47,74,77,444,447,474,477,744,747,774,777};
		int n=in.nextInt();
		int i=0;
		boolean yes=false;
		while((i<14)&&(a[i]<=n)){
			if(n%a[i]==0){
				System.out.print("YES");
				yes=true;
				break;
			} i++;
		}
		if(!yes)
		System.out.print("NO");
	}
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;
/**
 * Write a description of class lukno here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class lukno
{
    public static void main (String args[])
    {
        Scanner i= new Scanner(System.in);
        int n,p;
        
       
        n=i.nextInt(); int t=n;
        while(n!=0)
        {
            p=n%10;
            if(p!=4||p!=7)
           { if(t%7==0||t%4==0||t%47==0||t%74==0||t%447==0||t%477==0||t%474==0)
               System.out.print("YES");
               else System.out.print("NO");

            break;}
            else System.out.print("NO");
            
            n=(n/10);
            }
           


}
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.io.*;
import java.util.*;

public class Main {
    StreamTokenizer in;
    BufferedReader inb;
    PrintWriter out;

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    public void run() throws Exception {
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(
                System.in)));
        inb = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        out.flush();
    }

    public int nextInt() throws Exception {
        in.nextToken();
        return (int) in.nval;
    }

    public int parseInt() throws Exception {
        return Integer.parseInt(inb.readLine());
    }

    public String nextLine() throws Exception {
        return inb.readLine();
    }

    
    public void solve() throws Exception {
        int n = nextInt();
        if ((n%4==0)||(n%44==0)||(n%47==0)||(n%74==0)
                ||(n%744==0)||(n%747==0)||(n%774==0)||(n%777==0)
                ||(n%7==0)||(n%444==0)||(n%447==0)||(n%474==0)||(n%477==0)||(n%77==0))
        {
            out.print("YES");
        }
        else
        {
            out.print("NO");
        }
    }

}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A_122 {
public static void main(String[] args) throws NumberFormatException, IOException {
	BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	int n = Integer.parseInt(bf.readLine());
	  System.out.println((n%4==0||n%7==0||n%47==0||n%74==0||n%447==0||n%474==0||n%477==0||n%744==0||n%747==0||n%774==0)?"YES":"NO");
}
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.io.*;
import java.util.*;

public class lucky
{ 
   public static void main(String args[]) throws IOException
   { 
    BufferedReader cin=new BufferedReader(new InputStreamReader(System.in));
    
    String s=cin.readLine();
    int l=s.length();
    int n=Integer.parseInt(s);
    if(s.equals("47") || s.equals("4") || s.equals("7") || s.equals("74") || s.equals("447") || s.equals("477") || s.equals("474") || s.equals("44") || s.equals("77") || s.equals("444") || s.equals("777") || s.equals("747") || s.equals("774") || s.equals("744"))
          
          System.out.println("YES");
    else if(n%(47)==0 || n%(4)==0 || n%(7)==0 || n%(74)==0 || n%(447)==0 || n%(477)==0 || n%(474)==0 || n%(44)==0 || n%(77)==0 || n%(444)==0 || n%(777)==0  || n%(747)==0  || n%(774)==0  || n%(744)==0)
            System.out.println("YES");
    else
            System.out.println("NO");
            }
 }
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;
import java.util.StringTokenizer;

/**
 * Created with IntelliJ IDEA.
 * User: Саша
 * Date: 08.08.12
 * Time: 14:12
 */
public class LuckyDivision {

    public final String check (String s) {
        String result = "NO";
        StringTokenizer stringTokenizer = new StringTokenizer(s, "47");
        if(!stringTokenizer.hasMoreTokens()) return "YES";
        int S = Integer.parseInt(s);
        generateSimpleAndDivide(S, 4, 4, 7);
        generateSimpleAndDivide(S, 7, 4, 7);
        if(lucky) return "YES";
        return result;
    }
    public static final void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print(new LuckyDivision().check(scanner.next()));
    }

    public void generateSimpleAndDivide(int divided, int n, int n1, int n2) {
        if(lucky || n >= divided) return;
        if(divided % n == 0) lucky = true;
        generateSimpleAndDivide(divided, Integer.parseInt(n + "" + n1), n1, n2);
        generateSimpleAndDivide(divided, Integer.parseInt(n + "" + n2), n1, n2);
    }
    private boolean lucky = false;
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;

public class A_Lucky_Division {
	public static void main(String[] args){
		Scanner input=new Scanner(System.in);
		int number=input.nextInt();
		int flag=0;
		if(number%4==0)flag=1;
		else if(number%7==0)flag=1;
		else if(number%47==0)flag=1;
		else if(number%74==0)flag=1;
		else if(number%444==0)flag=1;
		else if(number%447==0)flag=1;
		else if(number%474==0)flag=1;
		else if(number%477==0)flag=1;
		else if(number%744==0)flag=1;
		else if(number%747==0)flag=1;
		else if(number%774==0)flag=1;
		else if(number%777==0)flag=1;
		if(flag==1)System.out.println("YES");
		else System.out.println("NO");
		
	}
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if ((n%4==0)||(n%7==0)||(n%44==0)||(n%47==0)||(n%74==0)||(n%77==0)||(n%444==0)||(n%447==0)||(n%474==0)||(n%477==0)||(n%744==0)||(n%747==0)||(n%774==0)||(n%777==0)) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.io.*;
import java.util.*;

public class Sol122A {

	BufferedReader in;
	StringTokenizer st;
	PrintWriter out;

	String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}

	int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	long nextLong() throws Exception {
		return Long.parseLong(next());
	}

	double nextDouble() throws Exception {
		return Double.parseDouble(next());
	}

	void solve() throws Exception {
		long x = nextLong();
		out.println((x % 4) * (x % 7) * (x % 74) * (x % 47) * (x % 44) * (x % 77) * (x % 444) * (x % 447) * (x % 474) * (x % 477) * (x % 744) * (x % 747) * (x % 774) * (x % 777) == 0 ? "YES" : "NO");
	}

	void run() {
		try {
			Locale.setDefault(Locale.US);
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			solve();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public static void main(String[] args) {
		new Sol122A().run();
	}

}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		if (((n % 4) == 0) || ((n % 7) == 0) || ((n % 44) == 0) || ((n % 47) == 0) || ((n % 74) == 0) || ((n % 77) == 0) || ((n % 444) == 0) || ((n % 447) == 0) || ((n % 474) == 0) || ((n % 477) == 0) || ((n % 744) == 0) || ((n % 747) == 0) || ((n % 774) == 0) || ((n % 777) == 0))
			System.out.print("YES");
		else
			System.out.print("NO");
		in.close();
	}

}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.io.*;
import java.util.*;
public class solution {
    public static void main(String[] args) {
       Scanner in = new Scanner(System.in);
       int n = in.nextInt();
       boolean ok = (n % 4 == 0) || (n % 7 == 0) || (n % 47 == 0) || (n % 74 == 0) || (n % 447 == 0) || (n % 474 == 0) || (n % 477 == 0) || (n % 744 == 0) || (n % 747 == 0) || (n % 774 == 0);
       if (ok) System.out.println("YES"); else System.out.println("NO");
    } 
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.*;
public class Solution {
    public static void main(String[] args){
        Scanner cin=new Scanner(System.in);
        int n=cin.nextInt();
        if(n%4==0 || n%7==0 || n%44==0 || n%47==0 || n%74==0 || n%77==0 || n%444==0 || n%447==0 || n%474==0 ||
                n%477==0 || n%744==0 || n%747==0 || n%774==0 ||n%777==0) System.out.print("YES");
        else System.out.print("NO");
    }
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.util.*;

public class MainClass {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int arr[] = {4,7,47,74,447,474,477,744,747,774};
        int i=0, x = in.nextInt();
        while (i<arr.length)
        if (x%arr[i++] == 0)
        {
             System.out.print("YES");
             return;
        }
        System.out.print("NO");
    }
}
// Problem: 122_A. Lucky Division
// Time complexity: constant
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;

public class CF {
        BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=null;
        private void  solution() throws IOException{
   int n=nextInt();
   if((n % 4==0 && n>=4)||(n % 7==0 && n>=7) || (n % 44==0 && n>=44) || (n % 47==0 && n>=47) || (n % 77==0 && n>=77) || (n % 74==0 && n>=74)
   || (n % 444==0 && n>=444) || (n % 447==0 && n>=447) || (n % 474==0 && n>=74) || (n % 477==0 && n>=477) || (n % 744==0 && n>=744)
   || (n % 747==0 && n>=747) || (n % 777==0 && n>=777)){
           System.out.println("YES");
   }else{
                System.out.println("NO");}
        }
        String nextToken()throws IOException {
                if(st==null || !st.hasMoreTokens()){
                        st = new StringTokenizer(bf.readLine());
                }
                return st.nextToken();
        }
        int nextInt() throws IOException {
                return Integer.parseInt(nextToken());
        }

        long nextLong() throws IOException {
                return Long.parseLong(nextToken());
        }

        double nextDouble() throws IOException {
                return Double.parseDouble(nextToken());
        }

        public static void main(String args[]) throws IOException {
                new CF().solution();
        }
}