eolymp
bolt
Try our new interface for solving problems
Problems

Разрезание на квадраты

published at 4/3/24, 4:24:54 pm

include <iostream>

using namespace std;

int main() { int a, b, temp = 0; bool need = 1; cin >> a >> b; while (need) { if (a >= b) { temp = temp + a / b; a = a%b; } else { temp = temp + b / a; b = b%a; } if (a == 0 || b == 0) { need = 0; } } cout << temp; return 0; }