Sharing 2 monitors between 2 computers in different configurations

Solution 1:

What I do for my setup, with two monitors for two computers, is to use both inputs of the monitors (they each have VGA & DVI). The VGA both go to computer A, the DVI go to computer B. I then have a KVM with just the keyboard and mouse on it. Then you can switch monitor configurations using the monitor buttons, and keyboard/mouse using the KVM.

(Alternately, you could accomplish this with two KVM switches; one with just monitor A attached, to both computers; and one with one monitor B plus they keyboard and mouse, attached to both computers.)

Or you could use a remote desktop solution, like the builtin one in Windows, or use Chrome remote desktop. But I think that's outside the scope of your question.