When one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

Let's say we have three text boxes for positive numbers (say A,B, and C) that must satisfy the condition that their product is 1. For example, A=0.5, B=10, C=0.2, would be a valid input.

Once the user inputs any two of the numbers, the remaining text box is automatically filled in. So if the user inputs A = 0.5 and C = 0.2, the program will fill in B = 10.

Now let us say that the user tries to type 5 in the input box. What should be done?

  1. Do not let the user change B. The problem with this is that the input 5 may genuinely be correct, and one of the other fields is wrong. The user would presumably have to delete one of their other answers before being allowed to enter B, which would not be convenient.
  2. Notify the user that the criteria is not being met, and do not let them submit the form until they fix it. The problem with this is then the user has to manually ensure the criteria is being met, when it would be more convenient for the program to ensure this for them. Perhaps they only know two of the inputs, and want the program to calculate the third, for example.
  3. Modify A to 1 or C to 0.4. This is the option I want to use. The problem is that it is not clear which one to modify. It depends upon which box the user mistakenly entered. If A is correct and C is incorrect, we would not want the program to modify A.
    1. One way to resolve the problem is to put buttons for "locking" inputs. Then the program would only modify unlocked inputs. These seems overly complicated though.
    2. Update the "oldest" input (i.e. the one whose last update is oldest). The problem with this is it could get really confusing for the user on how to enter the three inputs they want.
    3. Use solution 2, but put a "update" button under each input that will update that box to meet the criteria. This is my best solution so far, but it again seems a little overcomplicated.
  4. 2D selector field. The criteria defines a 2D surface in 3D space. You could let the user select a point in this field, displaying the A, B, and C axis projected to it. The problem with this is that it is not precise.
  5. Something else?

Which of these is optimal UI?