We present a data-driven analysis of the resonant S-wave ππ→ππ and πK→πK reactions using the partial-wave dispersion relation. The contributions from the left-hand cuts are accounted for using the Taylor expansion in a suitably constructed conformal variable. The fits are performed to experimental and lattice data as well as Roy analyses. For the ππ scattering we present both a single- and coupled-channel analysis by including additionally the KK¯ channel. For the latter the central result is the Omn`es matrix, which is consistent with the most recent Roy and Roy-Steiner results on ππ→ππ and ππ→KK¯, respectively. By the analytic continuation to the complex plane, we found poles associated with the lightest scalar resonances σ/f0(500), f0(980), and κ/K∗0(700) for the physical pion mass value and in the case of σ/f0(500), κ/K∗0(700) also for unphysical pion mass values.