Take this schematic :
simulate this circuit – Schematic created using CircuitLab
Playing with Ohm's law, you get : R3.R1.VR+R3.R2.VP=(R1.R2+R1.R3+R2.R3).VA
If you set VR=0, VA shall be equal to VP/2=1.65V. You get :
R1=(R2.R3)/(R3+R2) (or R1=R2 parallel with R3)
For The maximum input voltage, 5V, VA=VP :
R3=R2.VP/(VRmax-VP) = R2 * 3.3 / (5-3.3)
With standard resistor values, you can pick : R1=10k, R2=16k, R3=30k
The gate should have a Schmidt trigger, and support any intermediate voltage at its input, for example an HC14.