You are on page 1of 5

Given sequences A and B of N integers.

You decide to choose


indices i1. i... i from the sequences which satisfy all of the
following conditions

1
Ai]+sqrt(A[,]) <Al},-1l
B B.1

Output the maximum number of indices that you can choose to


satisfy the aforementioned conditions

Input Format
The first line contains an integer, N, denoting the number of
elements in A
Each line i of the N subsequent lines (where 0 si<N) contains
an integer describing A||
Each line i of the N subsequent lines (where 0 si <
N) contains
an
integer describing B[)

Constraints
1<=N<= 105
Constraints
1<= N <= 10^5
1 < A[j<= 10^4
1 B l < = 10^4

Sample Input Sample Output Explanation

8 2 You can choose


8 indices 5 and 8
22
21
10
4
1
22
21
22
15
24
8
13
16
15
25

You can choose


13
indices 3 4 8 9
2
Jndeananth@gmail.com

13 5 You can choose


2
5 indices3, 4,8,9
and 13
1
5

nanth@gmal.com
Wwwww.w 9
wwwww 11

Com
11
17
9
12
a n t h
@ g n

AR
ndeaneanth@
ww

5 w.i

24
21
9
4 .con
11
17
11
20
14
15
6
18
5
21
JInaco

You can choose


16 indices 4, 8, 9 and
18
13
25
6
3
21
25
nanthOgmailCom
19
6
9
4
10 MA
indeanant
10
21
1
23
6
15
Ogmail.com
25
16
10
10
12
1
13
14
10
12
1
13
14
10
22
11
13
2
24
25

Languages: Python 3,Java Python, C#,C, Bash, PHP Clojure, Plain


JavaScript,Go, Ruby.RPerl,C++

You might also like