Is it possible with only 2 nodes?

Okay, I've made several solutions. Starting with 4 nodes.

Two solutions with 3 nodes

One solution with 3 nodes, but also using Math nodes

Most of all, I wondered if it was possible to solve this problem with 2 nodes.

I did not achieve it. Did anyone else succeed?🤔