20 and 40 day are prolonged water only or water /coffee tea salt or electrolyte only fasts.
You can take antihistamines and if you must ibuprofen while fasting but there is a risk associated with taking pain killers on an empty stomach. I take smaller amounts but this is at your own discretion. It would not break your fast.
Regarding electrolytes? Some use salt only or a blend of magnesium, no salt, salt, and baking soda. This is referred to as snake juice. I do better with some pink salt and No Salt if I feel the need. Too much salt can cause the runs.
Did I answer your questions??