Competitive Programming Solutions

GitHub
back to dashboard

I. Lucky Numbers

Codeforces - Contest #1 · limit: 1s · memory: 256MB · view on codeforces

input

39

output

YES
Main.java
static void solve() {

        // Write your solution here
        int i = in.nextInt();
        int unitDigit = i % 10;
        int tenthDigit = i / 10;
        if( unitDigit % tenthDigit == 0 || tenthDigit % unitDigit == 0)
            out.print("YES");
        else
            out.print("NO"); 
    }