Given a string s containing words separated by spaces and a non-negative integer k, rotate each word to the right by k positions (cyclically). Return the transformed string. A rotation by k means moving the last k characters of the word to its front. If k is larger than the word length, use k modulo word length. Preserve the original spacing between words (i.e., treat consecutive spaces as separators and keep empty segments).
("hello world", 2)"lohel ldwor"