Let's first introduce several definitions and notations from the Linear Algebra.
The letter R will always denote the field of real numbers. A vector space over R is a set X, whose elements are called vectors, and in which two operations, addition and scalar multiplication, are defined, with the following familiar algebraic properties: (I) To every pair of vectors x and y corresponds a vector x+y, in such a way that x + y = y + x and x + (y + z) = (x + y) + z; X contains a unique vector 0 such that x + 0 = x for every x(x is a element of X); and to each x(x is a element of X) corresponds a unique vector -x such that x + (-x) = 0. (II) To every pair (a,x) with a,x(a is a element of R and x is a element of X) corresponds a vector ax, in such a way that 1x = x, a(bx) = (ab)x, and such that the two distributive laws a(x + y) = ax + ay, (a+b)x = ax + bx hold. In a vector space V over the field R, the span of subspace by vectors v1 and v2 (v1 and v2 is elements of V) is defined as Span (v1, v2) = { av1 +bv2 : a,b is elements of R} Note: v1,v2 is subscript of a,b and every element of V representable in the form a_v1+b_v2 is called the linear combination of v1 and v2. Fortunately, the specific case you are going to tackle is not as perplexing as what is mentioned above. Consider two positive integers a and b which have no common factor other than 1 or -1. That is to say, a and b are relatively prime. Define the natural span of a and b as NSpan (a, b) = {sa + tb : s and t range over non-negative integers}. Now given two arbitrary positive integers m and n where m is less or equal than n, your job is to calculate the number of integers between m and n inclusively that do NOT belong to NSpan (a, b).
each line of output corresponds to each line of input.