Integer4. The positive integers A and B (A>B) are given. On the segment of length A, the maximum possible number of segments of length B (without overlays) are placed. Using the operation of integer division, find the number of segments B placed on the segment A.

Solution in Python 3:

import random

A = random.randrange(1,100)
B = random.randrange(1,A)
print("A = ", A)
print("B = ", B)
x = int(A/B)
print("Number of Bs in A: ", x)

Solution in C++:

#include <iostream>
using namespace std;
int main(){
int a,b;
cout << "Enter A: ";
cin >> a;
cout << "Enter B: ";
cin >> b;
cout << "The number of segments B in segment A: " << int(a/b);
return 0;
}