#include <iostream>
#include<stdio.h>
#include<string>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<map>
#include<set>
#include<vector>
using namespace std;
const int maxn=50010;
int n,q;
struct node
{
int l,r,id;
}query[maxn];
int k;
bool cmp(node a,node b)
{
if(a.l/k!=b.l/k)
return a.l/k<b.l/k;
return a.r<b.r;
}
struct Ans
{
long long a,b;
void reduce()
{
long long d=__gcd(a,b);
a/=d;
b/=d;
return;
}
}ans[maxn];
int a[maxn],num[maxn];
void work()
{
long long temp=0;
memset(num,0,sizeof(num));
int L=1;
int R=0;
for(int i=0;i<q;i++)
{
while(R<query[i].r)
{
R++;
temp-=(long long)num[a[R]]*num[a[R]];
num[a[R]]++;
temp+=(long long)num[a[R]]*num[a[R]];
}
while(R>query[i].r)
{
temp-=(long long)num[a[R]]*num[a[R]];
num[a[R]]--;
temp+=(long long)num[a[R]]*num[a[R]];
R--;
}
while(L>query[i].l)
{
L--;
temp-=(long long)num[a[L]]*num[a[L]];
num[a[L]]++;
temp+=(long long)num[a[L]]*num[a[L]];
}
while(L<query[i].l)
{
temp-=(long long)num[a[L]]*num[a[L]];
num[a[L]]--;
temp+=(long long)num[a[L]]*num[a[L]];
L++;
}
ans[query[i].id].a=temp-(R-L+1);
ans[query[i].id].b=(long long)(R-L+1)*(R-L);
ans[query[i].id].reduce();
}
}
int main()
{
while(~scanf("%d %d",&n,&q))
{
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
for(int i=0;i<q;i++)
{
scanf("%d %d",&query[i].l,&query[i].r);
query[i].id=i;
}
k=(int)sqrt(n);
sort(query,query+q,cmp);
work();
for(int i=0;i<q;i++)
{
printf("%lld/%lld\n",ans[i].a,ans[i].b);
}
}
return 0;
}