-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha.java
executable file
·126 lines (110 loc) · 3.05 KB
/
a.java
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import java.util.*;
import java.io.*;
// public class Solution implements Runnable
class Solution implements Runnable
{
public static void main(String[] args) throws IOException {
br=new BufferedReader(new InputStreamReader(System.in));
nextIntBuffer = new String[0];
bos = new OutputStreamWriter(new BufferedOutputStream(System.out));
new Thread(null, new Solution(), "Main", 1<<28).start();
}
static BufferedReader br;
static String nextIntBuffer[];
static int nextIntBase;
static OutputStreamWriter bos;
static int nextInt() {
return Integer.parseInt(next());
}
static long nextLong() {
return Long.parseLong(next());
}
static String next() {
try{
if(nextIntBase>=nextIntBuffer.length) {
nextIntBase =0;
nextIntBuffer = br.readLine().split(" ");
}
}catch(IOException e) {}
return nextIntBuffer[nextIntBase++];
}
static void print (String s) {try{ bos.write(s); }catch(IOException e){}}
static void print (int s) {try{ bos.write(String.valueOf(s)); }catch(IOException e){}}
static void print (long s) {try{ bos.write(String.valueOf(s)); }catch(IOException e){}}
static void print (double s) {try{ bos.write(String.valueOf(s)); }catch(IOException e){}}
static void println (String s) {try{ print(s); bos.write('\n'); }catch(IOException e){}}
static void println (int s) {try{ print(s); bos.write('\n'); }catch(IOException e){}}
static void println (long s) {try{ print(s); bos.write('\n'); }catch(IOException e){}}
static void println (double s) {try{ print(s); bos.write('\n'); }catch(IOException e){}}
public static <T1 extends Comparable<T1> ,T2 extends Comparable<T2> > Pair<T1,T2> mp(T1 a,T2 b) {
return new Pair<T1,T2>(a,b);
}
public void main() {
br=new BufferedReader(new InputStreamReader(System.in));
nextIntBuffer = new String[0];
int t=1;
while(t-->0) {
int n=nextInt();
int c=0;
for (int i=1;i<n ;i++ ) {
if((n-i)%i==0)
c++;
}
println(c);
}
}
public void run() {
try
{
main();
bos.flush();
}catch(IOException e) {
e.printStackTrace();
}
}
static long pow(long x,long y,long mod)
{
if (y==0) return 1;
long z=pow(x,y/2,mod)%mod;
if(y%2==0) return (z*z)%mod;
else return (((x*z)%mod)*z)%mod;
}
static long gcd(long q,long d) {
long x1[]=new long[1];long y1[]=new long[1];
return gcd(q,d,x1,y1);
}
static long gcd(long q,long d,long x[],long y[]) {
if(d%q==0) {
x[0]=1;
y[0]=0;
return q;
}
long x1[]=new long[1];long y1[]=new long[1];
long ans = gcd(d%q,q,x1,y1);
y[0]=x1[0];
x[0]=y1[0]-(d/q)*x1[0];
return ans;
}
static long Inv(long n,long m) {
long x[]=new long[1];long y[]=new long[1];
long g= gcd(n,m,x,y);
if(g==1) {
return (x[0]+m)%m;
}
return -1;
}
}
class Pair<T1 extends Comparable<T1>, T2 extends Comparable<T2> > implements Comparable<Pair<T1,T2> > {
T1 a;
T2 b;
public Pair(T1 x, T2 y) {
a = x; b = y;
}
@Override
public int compareTo(Pair<T1,T2> other) {
int comp1 = a.compareTo(other.a);
if(comp1!=0)
return comp1;
return b.compareTo(other.b);
}
}