#include <iostream>
#include <queue>
#include <map>
#include <algorithm>
#include <cstdio>
using namespace std;

struct NODE{
	int to;
	int bit;
	double cost;
	NODE(int to, double cost) : to(to) , cost(cost) {}
	NODE(int to, double cost,int bit) : to(to) , cost(cost) , bit(bit) {}
	NODE(){}
};
bool operator < (const NODE &a,const NODE &b){
	return a.cost > b.cost;
}
int main(){
	int t,n,m,s,g;
	while(cin >> t >> n >> m >> s >> g&& t){
		s--;g--;
		int info[10];
		vector<NODE> v[31];
		for(int i = 0 ; i < t ; i++) cin >> info[i];
		for(int i = 0 ; i < m ; i++){
			int x,y,z;
			cin >> x >> y >> z;
			x--,y--;
			v[x].push_back(NODE(y,z));
			v[y].push_back(NODE(x,z));
		}
		bool used[31][1<<8] = {0};
		priority_queue<NODE> Q;
		Q.push(NODE(s,0,0));
		while(Q.size()){
			NODE q = Q.top(); Q.pop();
			if(used[q.to][q.bit]) continue;
			else used[q.to][q.bit] = true;
			if(q.to == g){
				printf("%.8f",q.cost);
				cout << endl;
				goto exit;
			}
			for(int i = 0 ; i < v[q.to].size() ; i++)
				for(int j = 0 ; j < t ; j++){
					if(q.bit>>j&1)continue;
					Q.push(NODE(v[q.to][i].to, q.cost + v[q.to][i].cost / info[j] , q.bit|(1<<j) ) );
				}
		}
		cout << "Impossible" << endl;
		exit:;
	}
}