MathDB
Problems
Contests
National and Regional Contests
China Contests
ASDAN Math Tournament
2016 ASDAN Math Tournament
26
26
Part of
2016 ASDAN Math Tournament
Problems
(1)
2016 Guts #26
Source:
8/14/2022
The Euclidean Algorithm on inputs
a
a
a
and
b
b
b
is a way to find the greatest common divisor
gcd
(
a
,
b
)
\gcd(a,b)
g
cd
(
a
,
b
)
. Suppose WLOG that
a
>
b
a>b
a
>
b
. On each step of the Euclidan Algorithm, we solve the equation
a
=
b
q
+
r
a=bq+r
a
=
b
q
+
r
for integers
q
,
r
q,r
q
,
r
such that
0
≤
r
<
b
0\leq r<b
0
≤
r
<
b
, and repeat on
b
b
b
and
r
r
r
. Thus
gcd
(
a
,
b
)
=
gcd
(
b
,
r
)
\gcd(a,b)=\gcd(b,r)
g
cd
(
a
,
b
)
=
g
cd
(
b
,
r
)
, and we repeat. If
r
=
0
r=0
r
=
0
, we are done. For example,
gcd
(
100
,
15
)
=
gcd
(
15
,
10
)
=
gcd
(
10
,
5
)
=
5
\gcd(100,15)=\gcd(15,10)=\gcd(10,5)=5
g
cd
(
100
,
15
)
=
g
cd
(
15
,
10
)
=
g
cd
(
10
,
5
)
=
5
, because
100
=
15
⋅
6
+
10
100=15\cdot6+10
100
=
15
⋅
6
+
10
,
15
=
10
⋅
1
+
5
15=10\cdot1+5
15
=
10
⋅
1
+
5
, and
10
=
5
⋅
2
+
0
10=5\cdot2+0
10
=
5
⋅
2
+
0
. Thus, the Euclidean Algorithm here takes
3
3
3
steps. What is the largest number of steps that the Euclidean Algorithm can take on some integer inputs
a
,
b
a,b
a
,
b
where
0
<
a
,
b
<
1
0
2016
0<a,b<10^{2016}
0
<
a
,
b
<
1
0
2016
?Let
C
C
C
be the actual answer and
A
A
A
be the answer you submit. If
∣
A
−
C
∣
C
>
1
2
\tfrac{|A-C|}{C}>\tfrac{1}{2}
C
∣
A
−
C
∣
>
2
1
, then your score will be
0
0
0
. Otherwise, your score will be given by
max
{
0
,
⌈
25
−
2
(
∣
A
−
C
∣
20
)
1
/
2.2
⌉
}
\max\{0,\lceil25-2(\tfrac{|A-C|}{20})^{1/2.2}\rceil\}
max
{
0
,
⌈
25
−
2
(
20
∣
A
−
C
∣
)
1/2.2
⌉}
.
2016
Guts Round