Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2.  
  3. namespace kitkat
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string input = Console.ReadLine();
  10.  
  11.             int n = Convert.ToInt32(input.Split(' ')[0]);
  12.             int m = Convert.ToInt32(input.Split(' ')[1]);
  13.  
  14.             if (n % m == 0)
  15.                 Console.WriteLine(n / m);
  16.             else
  17.                 for (int i = 0; i < (m * n + 1); i++)
  18.  
  19.                     if (i % n == 0 && i % m == 0)
  20.                     {
  21.                         if (i != 0)
  22.                         {
  23.                             Console.WriteLine(i);
  24.                             break;
  25.                         }
  26.                     }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement