I suggest 1 cheap kvm, 2 hdmi switches, and a few hdmi port mirrors.
kvm1 manages your keyboard to input...
1 - dock input
2 - pc1 input
3 - pc2 input
hdmi switch 1:
dock video1 to screen1 left splitt
pc1 video 1 to screen1 (left split)
pc2 video 1 to screen 1 (left split)
hdmi switch 2:
dock video 1 to screen2 (right split)
dock video 2 to screen2
pc1 video 1 to screen2 (right split)
pc1 video 2 to screen2
pc2 video 1 to screen2 (right split)
pc2 video 2 to screen2
This setup lets you put any video 1 on the first screen, and any video1 or video2 output on the 2nd screen.
Ideally you'd want hdmi selectors with direct selections (a lot just have one button) that you push to cycle. Some also have remotes... you probably don't want multiple remotes, but pair the above with a programmable remote, and you could probably set it up so that you can switch screen confiugurations with one button. (and then set the usb input separately...)
not ideal; as its a bit more work to switch configurations but its doable for under $200, give or take; vs several hundreds to thousands for a matrix kvm.
Alternatively to that, I'd suggest software solutions. Making one unit the master, and then remoting into the other two various ways to accomplish what you need. Remote desktop / VNC / NX Machine ... etc. There are all kinds of solutions, cross platform, multimonitor support, etc...might work for you unless you are doing gaming or video editing.