Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. Raju and Tushar are two best friends. They are fod of weird things, so they decided that they will go to visit the weird lans called Brutforce Land. When they went there they saw a lots of strange things but the strangest of all of them was this : The Bruteforce Land has a language which has a total of n letters and the value of n is huge compared to the number of letters we use(only 26) and all the words are of length n having distinct letters! So, they went to the library for a part time job and discovered there a more stranger thing. There was a book which contains all possible words that can be made by the letters in Brutforce Land. So, that book was humongous obviously. So, the two friends understood that there are so many words there which are not used by the people of Brutforce Land. So, they decided to divide the words of that big book so that some unused words get deleted from there. As it was the first time these two visited this land Tushar observed other things and meanwhile Raju divided words of the book into 2, one part containing the totally unused words, and the other part containing some used and some unused words and he threw away the part containing only unused words. Then he saved the remaining words in their personal database and then went home. Next year they went to Brutforce Land again and saw that the government got to know their work of the previous year and so they replaced all the n letters with completely different new letters and made that big book again. So, Tushar and Raju again went to the library, now Tushar deleted half of the words and threw it out Then Raju took the rest part and deleted two third of the book containing unused words. So, the remaining part was one sixth of the original copy after the divisions done by Tushar and Raju. For some mysterious reason the two friends decided to visit the land each year exactly once. The friends now decide to work like this : If Tushar divides the book and takes 1 / k of the book containing both used and unused words, Raju will take that 1 / k part of the book and take 1 / (k + 1) part of it and save the remaining words in their database. They also decided that each year they would increase the value of k by 1. So, at their first visit k was equal to 1, in the second visit k was 2 and so on. When the government notices this each year they replaces the n letters with completely new n letters. Another thing that the two friends decided is they will not visit the land more strictly less than n times. Your task is to calculate the total number of words after m years saved in the database of Raju and Tushar. As it can be a huge number output your answer modulo 1000000007.
  2.  
  3. 1 <= n <= 10000000
  4. 1 <= m < n
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement