Write a script to divide the given two integers i.e. $M / $N without using multiplication, division and mod operator and return the floor of the result of the division.

Everyone knows this one:

sub MAIN(Int $M, Int $N) {
die "Error: division by zero" unless $N;
my $m = abs $M;
my $n = abs $N;
my $d = 0;
++$d while ($m -= $n) ≥ 0;
say ($M < 0 xor $N < 0) ?? -$d - 1 !! $d;
}

Classic.

Task #2

You are given an integer $N.

Write a script to check if the given number can be expressed as mn where m and n are positive integers. Otherwise print 0.

Please make sure m > 1 and n > 1.

BONUS: If there are more than one ways to express the given number then print all possible solutions.