/*
* 解题思路:
* 简单的排序后查找
*/
#include <stdio.h> #include <string.h> #include <stdlib.h> #define A 10010 int a[ A ]; int m,n; int cmp( const void *a , const void *b ) { return *( int *)a - *(int *)b; } int search( int x ) { int i; for( i=0;i<m;i++ ) if( a[ i ] == x ) return i; return -1; } int main( ) { int i; int total = 1; int vis,x; while( scanf("%d%d",&m,&n) && m && n ) { for( i=0;i<m;i++ ) scanf("%d",&a[ i ] ); qsort( a , m, sizeof( a[ 0 ] ) , cmp ); printf("CASE# %d:\n",total++ ); while( n-- ) { scanf("%d",&x); vis = search( x ); if( vis == -1 ) printf("%d not found\n",x); else printf("%d found at %d\n",x,vis+1 ); } } return 0; }