1. Abridged Problem Statement  
Given two positive integers x (numerator) and y (denominator), consider the decimal expansion of x/y. Determine  
- the number of digits after the decimal point before the repeating cycle begins (the non-recurring part length), and  
- the length of the repeating cycle.  
If the decimal terminates, the repeating cycle length is 0.

2. Detailed Editorial  

   a. Observation  
   When you perform long division of x by y in base 10, you generate a sequence of remainders r₀, r₁, r₂, … where r₀ = x mod y and  
   rₖ₊₁ = (rₖ × 10) mod y.  
   - If at some step rₖ = 0, the division terminates (finite decimal).  
   - Otherwise, since there are only y possible nonzero remainders, eventually a remainder must repeat. The first time you see a previously seen remainder, you have detected the start of a cycle.  

   b. Definitions  
   - Let visited[r] = the step index at which remainder r first appeared (0-based for the first digit after the decimal).  
   - Suppose at step k we get remainder r that was first seen at step j = visited[r].  
     • The non-recurring length = j.  
     • The cycle length = k − j.  
   - If we see remainder 0 at step k (and never saw 0 before), then the decimal terminates after k digits and cycle length = 0.  

   c. Algorithm  
   1. Compute the initial remainder r = x mod y.  
   2. If r = 0, output “0 0”.  
   3. Initialize a vector `visited` of size y, filled with –1.  
   4. Set step = 0.  
   5. While r ≠ 0 and visited[r] = –1:  
       – visited[r] = step  
       – r = (r*10) mod y  
       – step++  
   6. If r = 0, the decimal terminates:  
       – non_recurring = step, cycle_length = 0  
   7. Else r repeated:  
       – non_recurring = visited[r]  
       – cycle_length = step − visited[r]  
   8. Print non_recurring and cycle_length.  

   d. Complexity  
   Each iteration either stops (r = 0) or marks a new remainder. There are at most y iterations, so O(y) time and O(y) memory. With y ≤ 10^6, this is efficient.

3. Provided C++ Solution with Detailed Comments  
```cpp
#include <bits/stdc++.h>
using namespace std;

// Find, for x/y in decimal, how many digits before the repeating cycle starts
// and the length of that cycle.
pair<int, int> find_decimal_info(int x, int y) {
    // visited[r] = index of digit when remainder r first appeared, -1 if unseen
    vector<int> visited(y, -1);

    // initial remainder after subtracting integer part
    int rem = x % y;
    int step = 0;  // counts how many decimal digits we've produced

    // simulate long division
    // stop if remainder is zero (finite decimal) or we see a repeat
    while (rem != 0 && visited[rem] == -1) {
        visited[rem] = step;         // mark when we saw this remainder
        rem = (rem * 10) % y;        // next remainder in long division
        ++step;                      // one more decimal digit
    }

    // if rem == 0, decimal terminated after 'step' digits
    if (rem == 0) {
        return {step, 0};            // no repeating cycle
    }
    // otherwise rem has repeated: cycle from visited[rem] to current step
    int first_occurrence = visited[rem];
    int cycle_len = step - first_occurrence;
    return {first_occurrence, cycle_len};
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int x, y;
    cin >> x >> y;

    // get non-recurring length and cycle length
    auto result = find_decimal_info(x, y);
    cout << result.first << ' ' << result.second << "\n";
    return 0;
}
```

4. Python Solution with Detailed Comments  
```python
def find_decimal_info(x, y):
    # visited[r] = index of digit when remainder r first appeared (-1 if unseen)
    visited = [-1] * y

    # initial remainder after integer part
    rem = x % y
    step = 0  # number of digits generated so far

    # long division simulation
    while rem != 0 and visited[rem] == -1:
        visited[rem] = step
        rem = (rem * 10) % y
        step += 1

    # if remainder became zero, decimal terminates
    if rem == 0:
        return step, 0  # non-recurring = step, cycle length = 0

    # found a cycle: starts at visited[rem], length = current step - start
    start = visited[rem]
    cycle_len = step - start
    return start, cycle_len

def main():
    x, y = map(int, input().split())
    non_rec, cycle = find_decimal_info(x, y)
    print(non_rec, cycle)

if __name__ == "__main__":
    main()
```

5. Compressed Editorial  
Track remainders during long division of x by y. Record the first occurrence index of each remainder in an array. Upon seeing remainder 0, decimal terminates; non-recurring = number of digits produced, cycle = 0. Upon seeing a repeated remainder r, the cycle starts at visited[r], so non-recurring = visited[r], cycle = current_step − visited[r]. Time and memory O(y).