【题目大意】
给定n,b,q。对于无限长数列的a[],ai = b*q^i。问n是ai的前缀的概率。
【思路】
本题需要的知识点只有一个:本福特定律。(p.s. 我真想打死出题人,平时出出物理题就够了,现在出了个从来没有听过的本福特定律。。。)
只要q不为1,10,100,1000,就可以认为a[]数列是“一堆从实际生活得出的数据”。。。
//#pragma comment(linker, "/STACK:102400000,102400000")
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<cmath>
#include<cctype>
#include<string>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<map>
#include<set>
using namespace std;
#define MP(x,y) make_pair((x),(y))
#define PB(x) push_back(x)
typedef __int64 LL;
//typedef unsigned __int64 ULL;
/* ****************** */
const int INF=100011122;
const double INFF=1e100;
const double eps=1e-8;
//const LL mod=1000000007;
const int NN=100010;
const int MM=2000010;
/* ****************** */
double fun(LL n,LL x)
{
char s1[50], s2[50];
int i;
sprintf(s1, "%I64d", n);