#include<iostream>
#include<unordered_map>
#include<vector>
#include<cstring>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#define int long long
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define drep(a,b,c) for(int a=b;a>=c;a--)
#define all(a) a.begin(),a.end()
#define ai_jiang signed main()
using namespace std;
typedef long long ll;
namespace ai {
constexpr int N = 5e4+5;
int n,m,aa[N],p,q=1,l=1,r,st[N];
pair<int,int> pp[N];
struct node { int l,r,cnt; } a[N];
inline int read() {
int res=0,f=1; char ch=getchar_unlocked();
while(ch<'0'||ch>'9') { if(ch=='-') f=-1; ch=getchar_unlocked(); }
while(ch>='0'&&ch<='9') { res=(res<<3)+(res<<1)+(int)(ch-'0'); ch=getchar_unlocked(); }
return res*f;
}
inline int gcd(int x,int y) { return y?gcd(y,x%y):x; }
inline void add(int pos) { q<<=1; p+=st[aa[pos]]; st[aa[pos]]++; }
inline void del(int pos) { q-=r-l; --st[aa[pos]]; p-=st[aa[pos]]; }
inline bool cmp(node a,node b) {
if(a.l!=b.l) return a.l<b.l;
return a.r<b.r;
}
}
using namespace ai;
ai_jiang {
cin.tie(0);
cout.tie(0);
n=read(); m=read();
rep(i,1,n) aa[i]=read();
rep(i,1,m) a[i].l=read(),a[i].r=read(),a[i].cnt=i;
stable_sort(a+1,a+m+1,cmp);
rep(i,1,m) {
while(l<a[i].l) del(l++);
while(r>a[i].r) del(r--);
while(l>a[i].l) add(--l);
while(r<a[i].r) add(++r);
pp[a[i].cnt]=make_pair(p*2,(r-l+1)*(r-l));
}
rep(i,1,m) {
int p1=pp[i].first,p2=pp[i].second,gp=gcd(pp[i].first,pp[i].second);
if(gp==0) puts("0/1");
else cout<<p1/gp<<'/'<<p2/gp<<'\n';
}
return 0;
}