forked from daiwb/Algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path207.cpp
More file actions
32 lines (29 loc) · 643 Bytes
/
Copy path207.cpp
File metadata and controls
32 lines (29 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include <sstream>
#include <algorithm>
#include <iterator>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <cmath>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(a);i>=(b);--i)
typedef long long LL;
void run() {
for (LL n = 1; n <= 1000000; ++n) {
LL t = n * (n + 1);
LL m = (LL) (log(n + 1.0) / log(2.0));
//cout << t << " " << m << "/" << n << endl;
if (m * 12345 < n) {
cout << t << " " << m << "/" << n << endl;
return;
}
}
}
int main () {
run();
return 0;
}