How to solve this question ? Here n<=10^5 and k<=10^14

Revision en1, by Ryuma_7810, 2024-04-07 19:16:25

I have been unable to solve the question in this image. the most concerning part is k can be as large as 10^14 which doesn't give much options how to traverse and apply the logic. Please provide me a good approach to solve this

Tags help me, c++, python3

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Ryuma_7810 2024-04-07 19:17:19 838
en1 English Ryuma_7810 2024-04-07 19:16:25 281 Initial revision (published)