Euclid preparation. Simulations and nonlinearities beyond CDM. 4. Constraints on f (R) models from the photometric primary probes | Synapse