You have 4 servers which accept a positive number from 0 to 255 (8 bits). Each server takes it's input, performs a basic addition or subtraction of a single digit, non-zero number, and outputs the result. Each server performs the same operation as the other servers. Your goal is to figure out what that operation is in as few queries as possible.
The twist is that only one server is configured properly, and the others will invert the input, output, or both. However, you may proxy through any number of servers as a single query (meaning output from one server is used as input of another, but you are only told the final output).
A: Input --> Add/Subtract --> Output B: Input --> Add/Subtract --> !Output C: !Input --> Add/Subtract --> Output D: !Input --> Add/Subtract --> !Output
Here's an example of input 10 for each server having the operation of -3
A: 10 --> 10-3 --> 7 B: 10 --> 10-3 --> 248 C: 245 --> 245-3 --> 242 D: 245 --> 245-3 --> 13
A > B: 10 --> A --> B --> 251
What is the optimal strategy for figuring out what each server does? What is the optimal strategy for figuring out the configuration of each server?