Sounds like this is part of another question. If the charges on both are of the same sign but different charge magnitude then each will become (a + b)/2
If the charges are different in sign and of different magnitudes then | a - b| / 2 is the charge on both.
If the charges are = but of different sign, then each sphere will have a magnitude of 0.