Public submissions
Source code of every submission to this problem in this contest will be visible for everyone since 2013-12-13 17:15:56.

SMPSEQ5 - Fun with Sequences (Act 3)

You are given a sequence of n integers S = s1, s2, ..., sn and a sequence of m integers Q = q1, q2, ..., qm. Please, print in the ascending order all such i, that si = qi, i<=n, i<=m.

Input data specification

In the first line you are given one integer 2<=n<=100, and in the following line n integers:
-100 <= si <= 100, si <= si+1.

In the third line you are given one integer 2<=m<=100, and in the following line m integers:
-100 <= qi <= 100, qi <= qi+1.

Output data specification

The sequence of requested integers separated by spaces.

Example

Input:
5
-2 -2 -1 1 4 
6
-3 -2 -1 1 2 3

Output:
2 3 4

Added by:kuszi
Date:2013-11-14
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Public source code since: 2013-12-13 17:15:56

hide comments
2018-11-28 08:00:37
Can anyone explain this problem with example?
2015-06-01 11:12:14 jarvis
pardon!my mistake!
2015-06-01 11:10:52 jarvis
wrong testcase :P
2014-05-27 09:15:35 heman
help!!

Last edit: 2014-05-27 09:19:34
2014-01-18 07:09:06 Shashi Kant Prasad
@Chandrakant Chaturvedi: You should write the C code like

int main() {
...
return 0;
}
2014-01-16 18:57:26 Chandrakant Chaturvedi
Please let me know my error
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.