using System using System IO using System Collections Generic using Sy

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace testing
{
class Program
{
static void Main(string[] args)
{
StreamReader sr = new StreamReader("tests/in.txt");
String line = sr.ReadLine();
sr.Close();
String[] input = line.Split();
long n = Int64.Parse(input[0]);
long m = Int64.Parse(input[1]);
if (n > 100000000 || m > 100000000)
Environment.Exit(-1);
int k = 0;
while (n != m)
{
if (n > m)
n -= m;
else
m -= n;
k++;
}
StreamWriter file = new StreamWriter("tests/out.txt");
file.Write(k);
file.Close();
}
}
}