303682: CF711E. ZS and The Birthday Paradox
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
ZS and The Birthday Paradox
题意翻译
求一年有 2^n 天,k 个人出现两人生日相同的可能性是多少。 翻译贡献者:大奕哥题目描述
ZS the Coder has recently found an interesting concept called the Birthday Paradox. It states that given a random set of $ 23 $ people, there is around $ 50% $ chance that some two of them share the same birthday. ZS the Coder finds this very interesting, and decides to test this with the inhabitants of Udayland. In Udayland, there are $ 2^{n} $ days in a year. ZS the Coder wants to interview $ k $ people from Udayland, each of them has birthday in one of $ 2^{n} $ days (each day with equal probability). He is interested in the probability of at least two of them have the birthday at the same day. ZS the Coder knows that the answer can be written as an irreducible fraction ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF711E/8121bfbd453525218681493c31a89b9966c63f4e.png). He wants to find the values of $ A $ and $ B $ (he does not like to deal with floating point numbers). Can you help him?输入输出格式
输入格式
The first and only line of the input contains two integers $ n $ and $ k $ $ (1<=n<=10^{18},2<=k<=10^{18}) $ , meaning that there are $ 2^{n} $ days in a year and that ZS the Coder wants to interview exactly $ k $ people.
输出格式
If the probability of at least two $ k $ people having the same birthday in $ 2^{n} $ days long year equals ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF711E/8121bfbd453525218681493c31a89b9966c63f4e.png) ( $ A>=0 $ , $ B>=1 $ , ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF711E/e6e61966616224b0cd048d2e804450ec41f5e980.png)), print the $ A $ and $ B $ in a single line. Since these numbers may be too large, print them modulo $ 10^{6}+3 $ . Note that $ A $ and $ B $ must be coprime before their remainders modulo $ 10^{6}+3 $ are taken.
输入输出样例
输入样例 #1
3 2
输出样例 #1
1 8
输入样例 #2
1 3
输出样例 #2
1 1
输入样例 #3
4 3
输出样例 #3
23 128