Remember that the air at the closed end can't move, so the amplitude at that location is always zero: it is a node for the standing wave. The displacement or amplitude will be maximal at the speaker, it is an antinode. So the length of the pipe determines the wavelength. The distance between node and antinode of a wave is $\lambda/4$, so $l=\lambda/4$. The distance between two antinodes (or between two nodes) is $\lambda/2$ or $2l$. (see this link for more info).
Open ends (and speakers) are antinodes, closed ends are nodes. So to get a standing wave (using the same frequency), the distance between 2 speakers or between a speaker and open end must be $2l$ (or $4l$, $6l$..) and the distance between speaker and closed end must be $l$ (or $3l$, $5l$ ...). Only case D fits those conditions.
Note that I assumed that f is the lowest frequency (the fundamental frequency) that will produce a standing wave. f could also be the first (second, third..) harmonic, in which case $\lambda=4l/3$ ($4l/5$, $4l/7$ ...). But that doesn't matter in this specific case, since the options given only include lengths of $l$ and $2l$, and you know that $l$ is the distance between a node and an antinode. Which also means that at a distance of $2l$ from an antinode will be an antinode.