sql server – HOW TO GROUP BY DATETIME SETP BY 10 MINUTE OR 15 MINUTE OR …?

I WANT TO GET DATETIME PER Variable MINUTE LIKE 15 MINUTE OR 10 MINUTE OR …

MY QUERY SO FAR :

WITH cte AS (
    SELECT DATETIME,VALUE,
      ROW_NUMBER() OVER (PARTITION BY DATEADD(MINUTE, DATEDIFF(MINUTE, 0, t.datetime), 0)
        ORDER BY t.datetime) AS rn
    FROM INPUT t
)
SELECT
*
FROM cte
WHERE rn = 1
order by DATETIME 

THE OUTPUT I’M GETTING

DATETIME VALUE
2021-02-11 10:40:40.000 42
2021-02-11 10:41:40.000 123
2021-02-11 10:42:50.000 512
2021-02-11 11:43:40.000 123
2021-02-11 11:50:45.000 521
2021-02-11 11:51:50.000 51
2021-02-11 11:52:40.000 52
2021-02-11 12:00:45.000 12
2021-02-11 12:10:50.000 51

The output I’d like to get:

DATETIME VALUE
2021-02-11 10:40:40.000 42
2021-02-11 11:50:45.000 521
2021-02-11 12:00:45.000 12
2021-02-11 12:10:50.000 51

PARTITION BY 10 MINUTE

(DB FIDDLE LINK) : https://dbfiddle.uk/?rdbms=sqlserver_2017&fiddle=234d3a561ae05c61fbec1ed19e200db0