#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<set>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<iostream>
#include<string>
#include<cmath>
#define N 200010
#define FOR(i,a,b) for(i=(a);i<=(b);i++)
#define ROF(i,a,b) for(i=(a);i>=(b);i--)
typedef long long LL;
using namespace std;
struct poi{int x,y,o;}p[N],p2[N];
bool cmp1(poi a,poi b){return a.x<b.x||(a.x==b.x&&a.y<b.y);}
struct edge
{
  int x,y,z;
  bool operator ==(const edge b)
  {return x==b.x&&y==b.y&&z==b.z;}
}
E[10*N];
bool cmp3(edge a,edge b){return a.z<b.z||(a.z==b.z&&a.x<b.x)||(a.z==b.z&&a.x==b.x&&a.y<b.y);}
int t[N],col[N],ccnt[N],n,m;
bool cmp2(int *a,int *b){return *a<*b;}
int mdis(poi a,poi b){return abs(a.x-b.x)+abs(a.y-b.y);}
int f[N],c[N],cp[N],Len=0,K,pos[N],Ans,*l[N],len=0,pre[N],last[N],e[N],ci[N],cd[N],si,sd;
LL q[N],tmp;bool vis[N];
int getf(int x){if (f[x]!=x) f[x]=getf(f[x]);return f[x];}
int lowbit(int x){return x&(-x);}
void modify(int x,int v,int pt)
{
  for(int i=x;i>0;i-=lowbit(i))
   if (v<c[i]) c[i]=v,cp[i]=pt;
}
int query(int x)
{
  int res=2e9,pt=-1;
  for(int i=x;i<=m;i+=lowbit(i))
   if (c[i]<res) res=c[i],pt=cp[i];
  return pt;
}
void Add(int x,int y,int z){E[++Len].x=x;E[Len].y=y;E[Len].z=z;}
void add(int x,int y){pre[++len]=last[x];last[x]=len;e[len]=y;}
void MMST()
{
  int dir,i,idx=0;
  FOR(dir,1,4)
  {
    if (dir==3) 
     FOR(i,1,m) p[i].x=-p[i].x;
    if (dir==2||dir==4)
     FOR(i,1,m) {int t=p[i].x;p[i].x=p[i].y;p[i].y=t;}
    sort(p+1,p+1+m,cmp1);
    FOR(i,1,m) t[i]=p[i].y-p[i].x,l[i]=&t[i];
    sort(l+1,l+1+m,cmp2);
    FOR(i,1,m) *l[i]=i;
    memset(c,20,sizeof(c));
    memset(cp,0xff,sizeof(cp)); 
    ROF(i,m,1)
    {
      int pp=query(t[i]);
      if (pp!=-1) Add(p[i].o,p[pp].o,mdis(p[i],p[pp]));
      modify(t[i],p[i].x+p[i].y,i);
    }
  }
  sort(E+1,E+1+Len,cmp3);
  edge* P=unique(E+1,E+1+Len);
  Len=P-E-1;
  FOR(i,1,m) f[i]=i;
  FOR(i,1,Len)
  {
    int fx=getf(E[i].x),fy=getf(E[i].y);
    if (fx==fy) continue;
    add(E[i].x,E[i].y);add(E[i].y,E[i].x);
    f[fx]=fy;
  }
}
void calc(LL oc,LL nc){tmp-=oc*(oc-1)/2;tmp+=nc*(nc-1)/2;}
void i1(int L,int R)
{
  int i,oc,nc;
  FOR(i,L,R) {oc=ccnt[col[i]]++;nc=ccnt[col[i]];calc(oc,nc);}
}
void d1(int L,int R)
{
  int i,oc,nc;
  FOR(i,L,R) {oc=ccnt[col[i]]--;nc=ccnt[col[i]];calc(oc,nc);}
}
void DFS(int u,LL ans)
{
  q[u]=ans;vis[u]=1;
  for(int pt=last[u];pt;pt=pre[pt])
  {
    int v=e[pt];
    if (vis[v]) continue;
    int l1=p2[u].x,r1=p2[u].y;
    int l2=p2[v].x,r2=p2[v].y;
    tmp=ans;
    if (r1<l2||r2<l1)
    {
      i1(l2,r2);d1(l1,r1);
      DFS(v,tmp);
      d1(l2,r2);i1(l1,r1);
      continue;
    }
    if (r1<r2) i1(r1+1,r2);else if (r2<r1) d1(r2+1,r1);
    if (l1<l2) d1(l1,l2-1);else if (l2<l1) i1(l2,l1-1);
    DFS(v,tmp);
    if (r1<r2) d1(r1+1,r2);else if (r2<r1) i1(r2+1,r1);
    if (l1<l2) i1(l1,l2-1);else if (l2<l1) d1(l2,l1-1);
  }
}
LL gcd(LL a,LL b){if (b==0) return a;return a%b==0?b:gcd(b,a%b);}
int main()
{
  scanf("%d%d",&n,&m);int i,j;
  FOR(i,1,n) scanf("%d",&col[i]);
  FOR(i,1,m)
  {
    scanf("%d%d",&p[i].x,&p[i].y);p2[i]=p[i];
    p[i].o=i;
  }
  MMST();
  memset(vis,0,sizeof(vis));
  FOR(j,1,m) 
  {
    if (vis[j]) continue;
    int lt=p2[j].x,rt=p2[j].y;memset(ccnt,0,sizeof(ccnt));
    LL ans=0;FOR(i,lt,rt) ccnt[col[i]]++;
    FOR(i,1,n) ans+=(LL)ccnt[i]*((LL)ccnt[i]-1)/2;
    DFS(j,ans);
  }
  FOR(i,1,m)
  {
    LL r1=q[i];
    LL r2=p2[i].y-p2[i].x+1;
    r2=r2*(r2-1)/2;
    LL g=gcd(r1,r2);
    r1/=g,r2/=g;
    printf("%lld/%lld\n",r1,r2);
  }
}